pixeltrace Posted March 13, 2007 Share Posted March 13, 2007 guys, i need help. how do i display the total number of rows in a table let say $sql = "SELECT total number of specialization FROM applicant WHERE specialization = 'administration'"; echo = "total number"; what is the correct code for this? thanks! Quote Link to comment https://forums.phpfreaks.com/topic/42448-help-on-sql-query/ Share on other sites More sharing options...
emehrkay Posted March 13, 2007 Share Posted March 13, 2007 SELECT COUNT(specialization) AS total .... Quote Link to comment https://forums.phpfreaks.com/topic/42448-help-on-sql-query/#findComment-205952 Share on other sites More sharing options...
artacus Posted March 13, 2007 Share Posted March 13, 2007 SELECT COUNT(*) AS cnt FROM applicant WHERE specialization ='administration' ... or if you want all specs... SELECT specialization, COUNT(*) AS cnt FROM applicant GROUP BY specialization Quote Link to comment https://forums.phpfreaks.com/topic/42448-help-on-sql-query/#findComment-205954 Share on other sites More sharing options...
artacus Posted March 13, 2007 Share Posted March 13, 2007 Dang it emerkay stop doing that. LOL. Seriously there should be a mod to tell you who is replying to a thread before you reply. Quote Link to comment https://forums.phpfreaks.com/topic/42448-help-on-sql-query/#findComment-205955 Share on other sites More sharing options...
pixeltrace Posted March 13, 2007 Author Share Posted March 13, 2007 how do i display this? thanks! Quote Link to comment https://forums.phpfreaks.com/topic/42448-help-on-sql-query/#findComment-205963 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.