beridius
asked on
php for each
I have select statement
I need to get for each day between $date1 and $date2 show the amounts
$date1 is 03/02/2013 and $date2 = 05/02/2013 it would show results by each day
03/02/2013 04/02/2013 05/02/2013
id 10 id 20 id 30
client 20 Client 21 Client 60
select * from cdr where src ='103' and date BETWEEN $date1 and $date2
I need to get for each day between $date1 and $date2 show the amounts
$date1 is 03/02/2013 and $date2 = 05/02/2013 it would show results by each day
03/02/2013 04/02/2013 05/02/2013
id 10 id 20 id 30
client 20 Client 21 Client 60
you want 1 column per date, right?
while "easy" in php, not simple in mysql at all.
please clarify
while "easy" in php, not simple in mysql at all.
please clarify
Have you tried pivot sql query .Your answer lies in sql query.
http://stackoverflow.com/questions/4546433/pivot-sql-query-show-date-in-column
http://stackoverflow.com/questions/4546433/pivot-sql-query-show-date-in-column
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Thanks for the points and thanks for using EE, ~Ray
What does your data look like and your table definition.