How many in table?
Moderator: General Moderators
How many in table?
Ok, now i know this must be a basic command, but how do i get it to print the amount of rows in a table? (eg; dale_houses)
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
Code: Select all
SELECT COUNT(*) AS `total` FROM `table`-
malcolmboston
- DevNet Resident
- Posts: 1826
- Joined: Tue Nov 18, 2003 1:09 pm
- Location: Middlesbrough, UK
from what i have read in the past
the difference between mysql_num_rows + the count method is very little except on large tables where count is recommended
personally i use num_rows method on small tables and count on large tables
also, num_rows requires less lines of code to retrieve the value...
hope that helps
the difference between mysql_num_rows + the count method is very little except on large tables where count is recommended
personally i use num_rows method on small tables and count on large tables
also, num_rows requires less lines of code to retrieve the value...
hope that helps
-
fractalvibes
- Forum Contributor
- Posts: 335
- Joined: Thu Sep 26, 2002 6:14 pm
- Location: Waco, Texas