S
|
stiven 10/8/2011 |
For what i understood you want to get the month and the year from table 1 and then insert on table 2 the start date with the first day of that month and the end date with the last day of that month?? this is what i would do... I'M ASSUMING THAT YOU HAVE A DATE FIELD ON THE DATABASE IN THIS FORMAT 'YYYY-MM-DD' if you have it in different format you might have to adjust the code.. also notice not every month has 30 days..
|
S
|
swinma author 10/9/2011 |
Thanks <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=61338&image=1&table=forumreplies' class='bbc_emoticon' alt=':)' /> for the reply, |
C
|
cgphp 10/9/2011 |
Single quotes around the two date values are missing: $strSQLInsert = "insert into Facturen (fact_client_id, fact_code_id, fact_start, fact_eind) values (".$values["behandel_client_id"].", ".$fact_tmp2.", '".$fact_tmp_start."', '".$fact_tmp_eind."')"; |
S
|
stiven 10/9/2011 |
|
S
|
swinma author 10/9/2011 |
Single quotes around the two date values are missing: $strSQLInsert = "insert into Facturen (fact_client_id, fact_code_id, fact_start, fact_eind) values (".$values["behandel_client_id"].", ".$fact_tmp2.", '".$fact_tmp_start."', '".$fact_tmp_eind."')";
|
S
|
stiven 10/10/2011 |
try this one.... don't change the date format it looks like the date format on the DB is yyyy-mm-dd |
S
|
swinma author 10/10/2011 |
Many thanks Stivens and Cristian, this time it works <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=61366&image=1&table=forumreplies' class='bbc_emoticon' alt=':D' /> |