Can some one help me!!!!! Thanks in advance.
I have a table in mysql having fields mod_date(date type) primary key, mod_id(char(2)).
i want to insert dates starting from 2003-12-22 to 2004-10-31 into mod_date using php code. The code is as below
<?
include "dbcon.php"; // includes database path
$start='2003-12-21';
$end='2004-11-01';
$temp=$start;
while($temp!=$end)
{
$t1=mysql_query("insert into moddate(mod_date) values('$temp')");
$tempdsql=mysql_query("select adddate('$temp', interval 1 day)");
$tempd=mysql_fetch_array($tempdsql);
$temp=$tempd[0];
}
?>
The problem is : After completion of the loop in the database mod_date is not having the record starting with date value 2003-12-21. It is starting from 2004-01-09. why it is happening like this.
Can some one help me. I doubt the mySQL is having a bug !!!
Bug in the mySql - Help Please!!!
Moderator: General Moderators