Page 1 of 1

Easy but dont know how :)?

Posted: Mon Jan 02, 2006 7:42 am
by spamyboy
How to siplay how many lines in for e.g. users table ? I want to siplay how many users registered allready.

Posted: Mon Jan 02, 2006 8:49 am
by trukfixer

Code: Select all

$res = mysql_query('select count(*) as count from user_table');
$rows = mysql_fetch_assoc($res);

echo "we have a total of ".$rows['count']." Registered users";
d11wtq | fixed syntax error and mysql_fetch_result => mysql_fetch_assoc