Where Clauses Back | Forward | Home

'Language Reference'
  • Logical Operators

  • Relational Operators

  • Data Types

  • Column Types

  • Primary Keys

  • Functions

  • Where Clauses

  • LIKE Clauses

  • Limit Clauses

  • OrderBy Clauses

  • Notes


  • User Functions

    Database Functions

    Data Manipulation Functions

    Table Functions

    Error Handling Functions

    << Last Section ( Functions ) Where Clauses Next Section ( LIKE Clauses ) >>

    A where clause tells txtSQL what rows that you are looking for. Where clauses can be used in select(), delete() and update. A where clause is simply an array in the following format.

         array(['$column $op $value' [, $logicalOp]]...);

    where $column is the name of the column, $op is the operator to use, and $value is the value to check against. For more information on operators, see the relational operators section. For more information on logical operators, see the logical operators section.



    User-Contributed Comments for:
    Where Clauses
    Faraz Ali <SaiyanM at hotmail dot com>
    July 30, 2004, 11:18 pm
    When creating a 'where clause', there is a special column that is set-up for you to use; 'primary'.

    When txtSQL sees that you are using 'primary' as the column name, it automatically checks to see if there is a primary key assigned to this table, and if there is, it uses that column instead.

    For Example:
    <?php
    $sql
    ->select(array('where' => array('primary => 56')...));
    ?>