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! 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 .... 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 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. 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! Link to comment https://forums.phpfreaks.com/topic/42448-help-on-sql-query/#findComment-205963 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.