connect Back | Forward | Home

'Language Reference'

User Functions
  • connect

  • disconnect

  • grant_permissions

  • getUsers

  • version

  • query_count


  • Database Functions

    Data Manipulation Functions

    Table Functions

    Error Handling Functions

    << Last Section ( User Functions ) connect Next Section ( disconnect ) >>
    Usage bool connect ( $user, $pass )
    Purpose Connect to the txtSQL service
    Availability txtSQL >= 1.0.0

    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-Contributed Comments for:
    connect()
    No comments found;