aaricwon Posted February 24, 2008 Share Posted February 24, 2008 I have a database where it is very simple. Just people signing up. I would like to have displayed on my page: " ### People have signed up" and for the ### to increase every time another person signs up... Link to comment https://forums.phpfreaks.com/topic/92666-how-can-i-show-how-many-records-are-in-the-database/ Share on other sites More sharing options...
drisate Posted February 24, 2008 Share Posted February 24, 2008 <?php echo "We have "; echo @current(@mysql_fetch_assoc(@mysql_query("SELECT count(id) FROM accounts "))); echo " regestred members!"; ?> Link to comment https://forums.phpfreaks.com/topic/92666-how-can-i-show-how-many-records-are-in-the-database/#findComment-474871 Share on other sites More sharing options...
pocobueno1388 Posted February 24, 2008 Share Posted February 24, 2008 <?php $query = mysql_query("SELECT COUNT(*) FROM table")or die(mysql_error()); $num = mysql_num_rows($query); echo "$num People have signed up"; ?> Link to comment https://forums.phpfreaks.com/topic/92666-how-can-i-show-how-many-records-are-in-the-database/#findComment-474873 Share on other sites More sharing options...
drisate Posted February 24, 2008 Share Posted February 24, 2008 Yeah pocobueno1388's version will be executed faster then my super lazy querry lol Link to comment https://forums.phpfreaks.com/topic/92666-how-can-i-show-how-many-records-are-in-the-database/#findComment-474874 Share on other sites More sharing options...
aaricwon Posted February 24, 2008 Author Share Posted February 24, 2008 THANKS!!! Link to comment https://forums.phpfreaks.com/topic/92666-how-can-i-show-how-many-records-are-in-the-database/#findComment-474875 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.