PDA

View Full Version : this should be easy


mr_badger
06-29-2009, 06: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?

bee80
06-29-2009, 08: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;

bee80
06-30-2009, 08:22 PM
or use mysql_num_rows