emjez15 Posted January 21, 2011 Share Posted January 21, 2011 MY SQL Syntax: $sql="SELECT * FROM incidents WHERE incidentcreateddate BETWEEN '$datefrom' AND '$dateto' ORDER BY incidentid ASC" or die("cannot connect server "); I want this entries for the Date Range Specified Above to be : Complainant---Incident Count MarkGreen--------------3 Jha Ogbac --------------4 Peter Luciano --------- 10 Donald Guerero ------ 20 Link to comment https://forums.phpfreaks.com/topic/225201-how-do-i-count-how-many-times-each-entry-in-a-column-appears/ Share on other sites More sharing options...
kickstart Posted January 21, 2011 Share Posted January 21, 2011 Hi Something like this SELECT Complainant, COUNT(incidentid) FROM incidents WHERE incidentcreateddate BETWEEN '$datefrom' AND '$dateto' GROUP BY Complainant All the best Keith Link to comment https://forums.phpfreaks.com/topic/225201-how-do-i-count-how-many-times-each-entry-in-a-column-appears/#findComment-1163310 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.