Possible Duplicate:
MySQL pivot row into dynamic number of columns
I have a query that shows number of items per day
$query = "SELECT uploadedby, count(item) as item, date_format(uploaddate, '%m-%d-%y') as date FROM `imsexport` GROUP BY uploadedby,date";
$result = mysql_query($query);
The resulting table looks like this
   Name        item    date
Abel Antonio    10   01-02-12
Abel Antonio    5    01-03-12
Abel Antonio    6    01-04-12
Abel Antonio    2    01-05-12
Abel Antonio    1    01-09-12
Abel Antonio    15   01-12-12
Abel Antonio    22   01-16-12
Abel Antonio    15   01-17-12
Abel Antonio    7    01-19-12
Abel Antonio    45   02-15-12
Abel Antonio    31   02-16-12
...other names
I'd like to make the the dates as columns to make the query look like this
Name          01-02-12  01-03-12   01-04-12   01-05-12    01-09-12 ....
Abel Antonio    10         5          6          2           1     .....
Anyone know how to accomplish this?
 
     
     
    