致命错误:未捕获的异常'mysqli_sql_exception'与消息
问题描述:
我想从用户获取一个值,然后更新开始时间和结束时间在表中标记。但我得到这个错误:致命错误:未捕获的异常'mysqli_sql_exception'与消息
Fatal error: Uncaught exception 'mysqli_sql_exception' with message Table 'fyp.biding' doesn't exist' in
C:\xampp\htdocs\fyp\profile\user\sadd_property_bidding.php:61 Stack trace: #0
C:\xampp\htdocs\fyp\profile\user\sadd_property_bidding.php(61): mysqli_query(Object(mysqli), 'UPDATE biding S...') #1 {main} thrown in
C:\xampp\htdocs\fyp\profile\user\sadd_property_bidding.php on line 61
//Change the 25 to however many minutes you want to countdown
$targetDate = strtotime('+3 days');
$actualDate = time();
echo $targetDate;
echo $actualDate;
$sql2 = "UPDATE biding SET start='$actualDate', end='$targetDate' WHERE
id='$id'";
$result2 = mysqli_query($con, $sql2) or die(mysqli_error());
答
Fatal error: Uncaught exception 'mysqli_sql_exception' with message Table 'fyp.biding' doesn't exist' in
这是明确的,因为你永远得到一个错误信息。表biding
不存在。它可能是名称中的拼写错误,或者您没有创建它。
似乎你的错误与一个不存在的表相关,你可以在你的代码中发布mysql连接的相关部分,还可以在mysql安装中发布数据库/表吗? – kainlite
你可以发布你的连接信息吗? (删除密码)正如我可以看到它尝试连接到Fyp数据库。它是你的表所在的数据库的名称?如果没有,你可以尝试指定数据库,就像这样:'UPDATE tablename.biding SET ...' –
–