WA_IGNORE not appearing to work
Hello Ray
I have been on with this issue for a day or more and I cannot get this to work - whatever I do I cannot get the behaviour to ignore the field update.
Essentially I have a form which accepts a number, which in turn adds days to a field and updates the record.
The resulting date seems to be OK, and if the form field ('add_days') is filled in, all works perfectly.
If the form field is left blank, however, the MySQL field always results in the famous '1970-01-01'.
I have tried many ways; here is my latest attempt;
<?php
if (isset($_POST['add_days'])) {
$newdate = strtotime(date("Y-m-d", strtotime($rsLoads->getColumnVal("fabdate")))." + ".$_POST['add_days']. "days");
$newdate = date('Y-m-d', $newdate);
}
?>
<?php
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$UpdateQuery = new WA_MySQLi_Query($connLoadTracker);
$UpdateQuery->Action = "update";
$UpdateQuery->Table = "lt_loads";
$UpdateQuery->bindColumn("fabdate", "t", "".$newdate ."", "WA_IGNORE");
$UpdateQuery->addFilter("UID", "=", "i", "51");
$UpdateQuery->execute();
$UpdateGoTo = "";
if (function_exists("rel2abs")) $UpdateGoTo = $UpdateGoTo?rel2abs($UpdateGoTo,dirname(__FILE__)):"";
$UpdateQuery->redirect($UpdateGoTo);
}
?>
Do you please have any idea why this just will not work?
Many thanks
Steve