Link to home
Start Free TrialLog in
Avatar of beridius
beridius

asked on

php for each

I have select statement


select * from cdr where src ='103' and date BETWEEN $date1 and $date2  

Open in new window


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
Avatar of Julian Hansen
Julian Hansen
Flag of South Africa image

It is not clear from your post what you are looking for.

What does your data look like and your table definition.
you want 1 column per date, right?
while "easy" in php, not simple in mysql at all.
please clarify
Avatar of rinfo
rinfo

Have you tried pivot sql query .Your answer lies in sql query.
http://stackoverflow.com/questions/4546433/pivot-sql-query-show-date-in-column
ASKER CERTIFIED SOLUTION
Avatar of Ray Paseur
Ray Paseur
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks for the points and thanks for using EE, ~Ray