Home    Back    Forward    Refresh    txtSQL Homepage

connect
Purpose: Connect to the txtSQL service
txtSQL >= 1.0.0
bool connect ( $user, $pass )

This function connects you to the txtSQL service as $user. If the user does not exist, or the password is incorrect, then this function will return false. It also issues an error warning, which can be surpressed using strict(0). Once connected, you can disconnect using disconnect()


Example 1: connect() Copy to clipboard
<?php
include('./txtSQL.class.php');
$sql = new txtSQL('./data');
$sql->connect('root', '') or die('Error occurred while connecting, txtSQL said: '.$sql->get_last_error());
?>


User Comments - connect
No comments posted yet;
Last Page Next Page

'Language Reference'

User Functions
  • connect
  • disconnect
  • grant_permissions
  • getUsers
  • version
  • query_count

    Database Functions

    Data Manipulation Functions

    Table Functions

    Error Handling Functions

    SQL Syntax

  • [ txtSQL Documentation powered by txtSQL | 6 SQL Queries ]