View Full Version : this should be easy

06-29-2009, 05:00 PM
I want to be able to display on a page how many rows are in a database but with just 1 number for example if there are 6 rows in my mysql table I want to output that are just 6 items in the database. So instead of showing 1,2,3,4,5,6 it would just show 6 or if I had 18 items it would just output 18 instead of listing all the numbers.

Any ideas?

06-29-2009, 07:31 PM
im not sure but i think if u use a select statement and grab the data , put it in an array then set a variable to to count the items in the array.

$var = count($array);
echo $var;

06-30-2009, 07:22 PM
or use mysql_num_rows