table_count Back | Forward | Home

'Language Reference'

User Functions

Database Functions

Data Manipulation Functions

Table Functions
  • showtables

  • createtable

  • droptable

  • altertable

  • describe

  • table_count

  • empty_cache

  • table_exists

  • last_insert_id


  • Error Handling Functions

    << Last Section ( describe ) table_count Next Section ( empty_cache ) >>
    Usage int table_count ( $table [, $db]) )
    Purpose To get the number of records in a txtSQL table
    Availability txtSQL >= 2.0.0 Beta

    This function will return the number of records inside of a txtSQL table. It will look inside the $db if specified, and if not, txtSQL will look in the selected database.

    Note- If $tablename does not already exists, txtSQL will issue an error
    Note- If no $db is specified and no database is already selected, txtSQL will issue an error

    Example 27: table_count() Copy to Clipboard
    <?php
    $count
    = $sql->table_count('testTable', 'testDb');

    echo
    'There are '.$count.' number(s) of records table "testTable"');
    ?>

    User-Contributed Comments for:
    table_count()
    No comments found;