flyerball10 Posted July 19, 2007 Share Posted July 19, 2007 I need to generate a query that shows the total of 'click' activity for the previous year up-to date group by the 'desination_url'. Here is an example. +---------------------+--------+---------+------+------------+------------+ | destination_url | July | June | May | April | March | +---------------------+--------+---------+------+------------+------------+ | www.yahoo.com | 15 | 15 | 12 | 9 | 12 | | www.phpfreaks.com | 23 | 33 | 10 | 7 | 10 | +---------------------+--------+---------+------+------------+------------+ Kind of like a cross tab query of some sort. Please help. I'm stuck Quote Link to comment https://forums.phpfreaks.com/topic/60825-sql-query-help/ Share on other sites More sharing options...
jvrothjr Posted July 19, 2007 Share Posted July 19, 2007 $query2_command = "select count(*) from URL where Link = 'www.phpfreaks.com' and month = 'July'"; $CntRecordQuery = mysql_query($query2_command); $Cntvar=mysql_result($CntRecordQuery,0,"count(*)"); Quote Link to comment https://forums.phpfreaks.com/topic/60825-sql-query-help/#findComment-302688 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.