How to Insert Multiple Datas into database for each month in my $dateentry
I have 6 dates. I need to store them into database with the same ID.
mysql_query("INSERT INTO testtable (ID, MonthEntries) VALUES('1','$dateentry')")
or die(mysql_error());
$dateentry = 2010-01-01, 2010-02-01, 2010-03-01, 2010-04-01, 2010-05-01, 2010-06-01,
Structure ID=INT MonthEntries=DATE
for every dates in $dateentry I need to insert them each with the same ID. example data table output in my database table below.
-------------------
ID | MonthEntries |
01 | 2010-01-01 |
01 | 2010-02-01 |
01 | 2010-03-01 |
01 | 2010-04-01 |
01 | 2010-05-01 |
01 | 2011-06-01 |
-------------------
I think that I need to use for loop in sql query but I'm a bit lost and I don't know how to construct it.