I've been struggling with creating a rate report based on data extracted from a Mysql table. I had written a piece of PHP code for creating the type of report I needed but it has turned out buggy and prone to errors. I then tried grouping the rates data in an sql statement but this omits lines and leaves my dates out of wack. Would someone be able to point me in the right direction with how the following table could be created with the below data.
Thanks for any suggestions on how to go about this. Rod 2002-05-01 | 2002-05-03 | 60 | 70 2002-05-04 | 2002-05-05 | 100 | 120 2002-05-06 | 2002-05-09 | 80 | 100 2002-05-10 | 120 | 140 2002-05-11 | 2002-05-14 | 60 | 70 2002-05-15 | 2002-05-18 | 40 | 60 CREATE TABLE rates ( id int(11) DEFAULT '0' NOT NULL auto_increment, ratedate date DEFAULT '0000-00-00' NOT NULL, rate1 smallint(6) DEFAULT '0' NOT NULL, rate2 mediumint(9) DEFAULT '0' NOT NULL, PRIMARY KEY (id) ); INSERT INTO rates VALUES ( '1', '2002-05-01', '60', '70'); INSERT INTO rates VALUES ( '2', '2002-05-02', '60', '70'); INSERT INTO rates VALUES ( '3', '2002-05-03', '60', '70'); INSERT INTO rates VALUES ( '4', '2002-05-04', '100', '120'); INSERT INTO rates VALUES ( '5', '2002-05-05', '100', '120'); INSERT INTO rates VALUES ( '6', '2002-05-06', '80', '100'); INSERT INTO rates VALUES ( '7', '2002-05-07', '80', '100'); INSERT INTO rates VALUES ( '8', '2002-05-08', '80', '100'); INSERT INTO rates VALUES ( '9', '2002-05-09', '80', '100'); INSERT INTO rates VALUES ( '10', '2002-05-10', '120', '140'); INSERT INTO rates VALUES ( '11', '2002-05-11', '60', '70'); INSERT INTO rates VALUES ( '12', '2002-05-12', '60', '70'); INSERT INTO rates VALUES ( '13', '2002-02-13', '60', '70'); INSERT INTO rates VALUES ( '14', '2002-05-14', '60', '70'); INSERT INTO rates VALUES ( '15', '2002-05-15', '40', '60'); INSERT INTO rates VALUES ( '16', '2002-05-16', '40', '60'); INSERT INTO rates VALUES ( '17', '2002-05-17', '40', '60'); INSERT INTO rates VALUES ( '18', '2002-05-18', '40', '60'); -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php