我有一个由页面构建的简单更新查询,代码如下。
<?php if ($resultADS->num_rows > 0) {
// output data of each row
while($rowADS = $resultADS->fetch_assoc()) {
//Reformat date to yyyy-mm-dd
$phpdate = strtotime( $rowADS['Assigned_Date_Sales'] );
$mysqldate = date( 'Y-m-d', $phpdate );
echo "ID: " . $rowADS['ID'] . " - " . $rowADS['Assigned_Date_Sales'] . " New Date: ". $mysqldate . "<br>";
$sqlADSupdate = "UPDATE customer_migration_details SET Assigned_Date_Sales_New = '" . $mysqldate . "' WHERE ID ='" . $rowADS['ID'] . "'<br>";
echo $sqlADSupdate;
$result = $conn->query($sqlADSupdate);
echo "Updated Assigned Sales Date: " . $rowADS['Assigned_Date_Sales_New'] . "<br><br>";
}
}
?>
唯一的问题是。它没有更新有问题的字段。
有任何想法吗
LEATH