...

View Full Version : count function for site



megamailfortune
03-25-2003, 11:37 PM
I need to know if anyone knows a member count code to be displayed via PHP, I am storing all membership info in a database, Need a count function on my table and get the number of records.

Thanks

Nightfire
03-25-2003, 11:59 PM
$link = mysql_connect("localhost", "mysql_user", "mysql_password");
mysql_select_db("database", $link);

$result = mysql_query("SELECT count(id) FROM members_table", $link);
$num_rows = mysql_num_rows($result);

echo "You have ".$num_rows." members\n";

megamailfortune
03-26-2003, 01:00 AM
Thank you for the info:o


Now to put this on table what file would I insert this code?



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum