Snippet Name: Counting rows Description: A reasonably fast way to get the number of rows in a table. Also see:» Simple directory viewer / browser » Recursive Directory Browser » Make alternating color table rows ... » Highlight table rows on rollover » Converting Rows to Columns » Dynamically Add/Remove rows in HTM... » UPDATE: Update multiple rows » Count rows in all tables » List tables with more than 'X' rows » Easy page browser » Hierarchical categories browser » Recursive Directory Browser » Browser sniffer / detector » Grouping rows by frequency » Detect Mobile/WAP browser » Find All Duplicate Rows Comment: (none) Author: CoderZone Language: MYSQL Highlight Mode: MYSQL Last Modified: February 28th, 2009
Description: A reasonably fast way to get the number of rows in a table.
Also see:» Simple directory viewer / browser » Recursive Directory Browser » Make alternating color table rows ... » Highlight table rows on rollover » Converting Rows to Columns » Dynamically Add/Remove rows in HTM... » UPDATE: Update multiple rows » Count rows in all tables » List tables with more than 'X' rows » Easy page browser » Hierarchical categories browser » Recursive Directory Browser » Browser sniffer / detector » Grouping rows by frequency » Detect Mobile/WAP browser » Find All Duplicate Rows
$total = mysql_result(mysql_query("SELECT COUNT(id) FROM yourtable"),0);