hi to all how to use from date to date for looping. my date format (YY/MM/DD) I have a date from 2009/01/05 to 2010/03/20 I want to execute into my sql query are select * from mytable where date_created between 2009/01/05 and 2009/01/31 //for 2009/01 (january 2009) records PHP: then next loop: select * from mytable where date_created between 2009/02/01 and 2009/02/31 //for 2009/01 (february 2009) records PHP: until to satisfied "to date (2010/03/20)"; any suggestion would greatly appreciated thanks in advance Tirso
Can you tell me what the data type of the date_created column is (datetime, date, timestamp, etc...)?
Your format will not work. You will need to do the following: // create a new field as DATE format select ALL dates - current foreach currentdate, convert to DATE -using explode insert DATE back // when done all dates, remove the current date format PHP: When this is done, you should have dates that can be searched, timed, etc.. Peace,