Easy but dont know how :)?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
spamyboy
Forum Contributor
Posts: 266
Joined: Sun Nov 06, 2005 11:29 am
Location: Lithuania, vilnius

Easy but dont know how :)?

Post by spamyboy »

How to siplay how many lines in for e.g. users table ? I want to siplay how many users registered allready.
User avatar
trukfixer
Forum Contributor
Posts: 174
Joined: Fri May 21, 2004 3:14 pm
Location: Miami, Florida, USA

Post 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
Post Reply