Mouse Posted March 23, 2006 Share Posted March 23, 2006 Total Members…I am just implementing a counter or two on my site… always a good way to promote membership and advertising revenue… The bit that I cant work out is how to display the number of members on my site whats the magic code to retrieve and echo the highest number in the $u_id column in my “user” table, i.e the number of members?Mouse Link to comment https://forums.phpfreaks.com/topic/5579-total-members%E2%80%A6-counter/ Share on other sites More sharing options...
redbullmarky Posted March 23, 2006 Share Posted March 23, 2006 trySQL:[!--sql--][div class=\'sqltop\']SQL[/div][div class=\'sqlmain\'][!--sql1--][span style=\'color:blue;font-weight:bold\']select[/span] [color=blue]count[/color](u_id) [color=green]as[/color] usercount [color=green]from[/color] [color=orange]user[/color] [!--sql2--][/div][!--sql3--]or something like:PHP:[code]$result = mysql_query("select u_id from user");$members = mysql_num_rows($result);[/code] Link to comment https://forums.phpfreaks.com/topic/5579-total-members%E2%80%A6-counter/#findComment-19911 Share on other sites More sharing options...
Mouse Posted March 23, 2006 Author Share Posted March 23, 2006 [!--quoteo(post=357558:date=Mar 23 2006, 12:08 PM:name=redbullmarky)--][div class=\'quotetop\']QUOTE(redbullmarky @ Mar 23 2006, 12:08 PM) [snapback]357558[/snapback][/div][div class=\'quotemain\'][!--quotec--]trySQL:[!--sql--][div class=\'sqltop\']SQL[/div][div class=\'sqlmain\'][!--sql1--][span style=\'color:blue;font-weight:bold\']select[/span] [color=blue]count[/color](u_id) [color=green]as[/color] usercount [color=green]from[/color] [color=orange]user[/color] [!--sql2--][/div][!--sql3--]or something like:PHP:[code]$result = mysql_query("select u_id from user");$members = mysql_num_rows($result);[/code][/quote]AHHHHHH!!!! I SEE MY ERROR... I FORGOT THE "" ARROUND THE SELECT STATEMENT oh foolish me!many thanksMouse Link to comment https://forums.phpfreaks.com/topic/5579-total-members%E2%80%A6-counter/#findComment-20003 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.