2015-06-21 558 views
-2

我想從用戶獲取一個值,然後更新開始時間和結束時間在表中標記。但我得到這個錯誤:致命錯誤:未捕獲的異常'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()); 
+2

似乎你的錯誤與一個不存在的表相關,你可以在你的代碼中發佈mysql連接的相關部分,還可以在mysql安裝中發佈數據庫/表嗎? – kainlite

+0

你可以發佈你的連接信息嗎? (刪除密碼)正如我可以看到它嘗試連接到Fyp數據庫。它是你的表所在的數據庫的名稱?如果沒有,你可以嘗試指定數據庫,就像這樣:'UPDATE tablename.biding SET ...' –

+0

<?php $ con = mysqli_connect('localhost','root','','fyp')或死(「數據庫錯誤」); > –

回答

0

Fatal error: Uncaught exception 'mysqli_sql_exception' with message Table 'fyp.biding' doesn't exist' in

這是明確的,因爲你永遠得到一個錯誤信息。表biding不存在。它可能是名稱中的拼寫錯誤,或者您沒有創建它。

相關問題