Home    Back    Forward    Refresh    txtSQL Homepage

table_count
Purpose: To get the number of records in a txtSQL table
txtSQL >= 2.0.0 Beta
int table_count ( $table [, $db]) )

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 Comments - table_count
No comments posted yet;
Last Page Next Page

'Language Reference'

User Functions

Database Functions

Data Manipulation Functions

Table Functions
  • showtables
  • createtable
  • droptable
  • altertable
  • describe
  • table_count
  • emptyCache
  • table_exists
  • last_insert_id

    Error Handling Functions

    SQL Syntax

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