johnc71 Posted August 7, 2008 Share Posted August 7, 2008 Ok, I am so tired right now and my brain is not cooperating... what I am trying to do is basically is count number of "type" records in first table and display them just like in table two. I was able to do this by running separate queries for each "type" and using mysql_num_rows to count results but there must be an easier way to do this. I tried Count and Group queries but without success... Any help is greatly appreciated! iduserdatetype 1john2008-08-01pdf 2mary2008-08-02pdf 3mary2008-08-03print 4david2008-08-03ppt 5david2008-08-04pdf 6john2008-08-04print 7david2008-08-05ppt 8mary2008-08-05ppt 9john2008-08-05ppt 10john2008-08-05pdf userprintpdfppt john121 mary111 david[/td][td]12 Link to comment https://forums.phpfreaks.com/topic/118577-need-help-with-counting-db-records/ Share on other sites More sharing options...
fenway Posted August 7, 2008 Share Posted August 7, 2008 These is classic "cross-tab" or "pivot-table"... Link to comment https://forums.phpfreaks.com/topic/118577-need-help-with-counting-db-records/#findComment-610747 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.