I have a php script accessing a mysql database and generating a report using mysql_fetch_array. After that, I am moving the results around in the script and performing some calculations before generating a report.
Data in the mysql data table essentially consists of a number of contibutions, with the donor, the date and the amount all in separate field for each record. I am trying to get a listing of the contributions by each donor, with the amount for each month listed in a separate column for each month.
The problem I am having is that while my script does this, it generates a separate line for the donor for each month there is a contribution. Thus, if there are three contributions in three separate months, I end up with three lines for that donor.
I would like a fix for this problem. Additionally, I am using just one date for each month such as 2007-01-31, but would like to have the script be able to combine amounts if there were more than one date for a donor in an amount.
Attached is a screen shot of the result I am currently getting, which shows the problem, as well as the script I am currently using. I have a mysql dump which can be sent if needed.
the problem is that u need to use the DISTINCT MYSQL function coreclty. I can show u how. I ama vailable to talk on yahoo or msn or skype using this id: xxxxxxxxxx thanks, Ciprian