作者:家具销售_903 | 2023-09-11 12:12
我正在使用UPDATE查询来更改我的数据库.我对一行中的特定单元格所做的更新会插入到数据库中.然而,正在发生的是在该单元格输入as 0000-00-00之后出现的任何空白日期空间.
例如,当我更新最终审核日期时,这就是我应该得到的
Before Update
Date Received Final Review Date Date Delivered Date Accepted
2015-03-03
After Update
Date Received Final Review Date Date Delivered Date Accepted
2015-03-03 2015-08-05
Instead I get this:
Date Received Final Review Date Date Delivered Date Accepted
2015-03-03 2015-08-05 0000-00-00 0000-00-00
我已经尝试过对此进行故障排除,但我对mysqli/php相当新,所以我知道我可能会错过一些简单的东西.任何帮助解决这个问题将不胜感激.
connect_error) {
die("Connection failed: " . $conn->connect_error);
}
if (isset($_POST['update'])){
$UpdateQuery = "UPDATE Projects SET Project='$_POST[project]', Client='$_POST[client]', LastName='$_POST[lastname]', DateReceived='$_POST[datereceived]', FinalReviewDate='$_POST[finalreviewdate]', DateDelivered='$_POST[datedelivered]', DateAccepted='$_POST[dateaccepted]' WHERE Project='$_POST[hidden]'";
mysqli_query($conn, $UpdateQuery);
};
$sql = "SELECT * FROM Projects";
$result = $conn->query($sql);
echo "
Project |
Client |
Last Name |
Date Received |
Final Review Date |
Date Delivered |
Date Accepted |
";
while($record = mysqli_fetch_array($result))
{
if ($result->num_rows > 0){
echo "";
}
}
echo "
";
?>
close();
?>