dazz_club Posted April 25, 2008 Share Posted April 25, 2008 Hi guys, I've got a database full of members, and what i would like to do for my admin page is to have a paragraph that informs me with updated info. What i want to know, or if someone can direct me to a good tut, is have a script that reads the amount of members i a from my table and simply have it displayed as a number. over all this is what i want to achieve and the number in bold are driving by a script the present the data as a number. --------------------- We have 14 enquiries, 2 new ones from Darren Azzopardi We have recieved 7 feedback comments Only 2 people have had problems loggin in ---------------------- kind regards Darren Link to comment https://forums.phpfreaks.com/topic/102892-solved-read-and-display-data-in-numerical-form/ Share on other sites More sharing options...
947740 Posted April 25, 2008 Share Posted April 25, 2008 You can use mysql_num_rows($queryresult) to find the total number (of results) for every query you perform. Link to comment https://forums.phpfreaks.com/topic/102892-solved-read-and-display-data-in-numerical-form/#findComment-527058 Share on other sites More sharing options...
Yesideez Posted April 25, 2008 Share Posted April 25, 2008 Total enquiries: SELECT COUNT(*) FROM `members` New enquiries: SELECT COUNT(*) FROM `members` WHERE `new`='yes' Number of comments: SELECT COUNT(*) FROM `feedback` WHERE `read`='no' Login problems: SELECT COUNT(*) FROM `members` WHERE `loginproblem`='yes' That's the basics but it depends on how you want to form the tables and how you're handling the data. Link to comment https://forums.phpfreaks.com/topic/102892-solved-read-and-display-data-in-numerical-form/#findComment-527061 Share on other sites More sharing options...
dazz_club Posted April 25, 2008 Author Share Posted April 25, 2008 Cheers dude, are you seriously 15? Link to comment https://forums.phpfreaks.com/topic/102892-solved-read-and-display-data-in-numerical-form/#findComment-527062 Share on other sites More sharing options...
dazz_club Posted April 25, 2008 Author Share Posted April 25, 2008 Cheers Yesideez I will work on these and get back to you guys with my progress. Link to comment https://forums.phpfreaks.com/topic/102892-solved-read-and-display-data-in-numerical-form/#findComment-527064 Share on other sites More sharing options...
947740 Posted April 25, 2008 Share Posted April 25, 2008 Yes, I am 15. Link to comment https://forums.phpfreaks.com/topic/102892-solved-read-and-display-data-in-numerical-form/#findComment-527065 Share on other sites More sharing options...
dazz_club Posted April 27, 2008 Author Share Posted April 27, 2008 Hi , I have set up a basic query, but i think i missing something as my result only retrieves 1 <?php $sql = "SELECT COUNT(*) FROM contacts"; $result = mysql_query($sql); echo mysql_num_rows($result); ?> kind regards Dazzclub Link to comment https://forums.phpfreaks.com/topic/102892-solved-read-and-display-data-in-numerical-form/#findComment-528505 Share on other sites More sharing options...
dazz_club Posted April 27, 2008 Author Share Posted April 27, 2008 hmm could be that i have selected the contacts row rather than the data in that field. could be..... *note to Dazzclub, look closer der brain. Link to comment https://forums.phpfreaks.com/topic/102892-solved-read-and-display-data-in-numerical-form/#findComment-528511 Share on other sites More sharing options...
dazz_club Posted April 27, 2008 Author Share Posted April 27, 2008 Done some tweaking to the code. Snow the code looks like this. <?php $sql = mysql_query("SELECT * FROM contacts"); $num_rows = mysql_num_rows($sql); echo "$num_rows Rows\n"; ?> and it works...well need to double check but its good for me Link to comment https://forums.phpfreaks.com/topic/102892-solved-read-and-display-data-in-numerical-form/#findComment-528514 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.