I am sending a "date" and "the number of days" from a form to a php page that calls for the MYSQL database to update all records equal to or after that date to move the "the number of days".
I thought this had been working but now it is not. It works fine until I get to a new month.
What happens is the calculation does not roll the month over and tries to put in a date like 12/36/2000. The field in the table is formatted as date so it does not accept this invalid date and inserts 0000-00-00.
Below is the code for the form and then the page it goes to.
<form name="form3" action="update2.php3" method="POST">
Move all records from
<input type="text" name="datevar" size="12" value="*DATE">
<input type="text" name="daysm" size="5" value="#">
day(s)</font></b>
<input type="submit" name="Submit" value="Submit">
</form>
<?
// connect to the database
$conn = mysql_connect("localhost");
mysql_select_db("kstran",$conn);
$result = mysql_query("select
date1,mat_num,product,sheet_num,thick,weight,size,color,company from
ksline1 where mat_num = '$mat_num'",$conn);
$result = mysql_query("update ksline1 set date1 = date1 + '$daysm' where date1 >= '$datevar' ");
mysql_close();
this closes the database connection
?>