pixeltrace Posted March 16, 2007 Share Posted March 16, 2007 guys, what is the code in displaying the total number of rows? let say in table applicant? $sql = SELECT ..... FROM applicant echo ..... ??? need help please! thanks! Quote Link to comment https://forums.phpfreaks.com/topic/42951-solved-how-to-display-total-number-of-rows/ Share on other sites More sharing options...
lJesterl Posted March 16, 2007 Share Posted March 16, 2007 I would use this ( I could be wrong) $sql=mysql_query("SELECT * FROM applicant'"); $result=mysql_num_rows($sql); There are $result applicants Quote Link to comment https://forums.phpfreaks.com/topic/42951-solved-how-to-display-total-number-of-rows/#findComment-208634 Share on other sites More sharing options...
DeathStar Posted March 16, 2007 Share Posted March 16, 2007 If you work with id's this would help ALOT!! $cnt = mysql_query("SELECT userid FROM users"); $membs = mysql_num_rows($cnt); Quote Link to comment https://forums.phpfreaks.com/topic/42951-solved-how-to-display-total-number-of-rows/#findComment-208635 Share on other sites More sharing options...
Kasuke_Akira Posted March 16, 2007 Share Posted March 16, 2007 "SELECT *" is sufficient as long as there are no stipulations and you just want a total of all users. So lJesterl is correct with his code. Quote Link to comment https://forums.phpfreaks.com/topic/42951-solved-how-to-display-total-number-of-rows/#findComment-208640 Share on other sites More sharing options...
pixeltrace Posted March 16, 2007 Author Share Posted March 16, 2007 thanks its working now! Quote Link to comment https://forums.phpfreaks.com/topic/42951-solved-how-to-display-total-number-of-rows/#findComment-208641 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.