2015-11-17 90 views
-2
include '../php_script/connectDB.php'; 
    $temp=$_POST['resitID']; 

    $query="DELETE FROM resit 
      WHERE resitid='$temp'"; 

    $result=mysqli_query($conn,$query); 
    if($result) 
    { 
     $_SESSION['error'] = "Resit deleted successfully."; 
     header('location: ./tutor_delete_page.php'); 
    } 

查詢確實運行,並且$ temp不爲空。不過到了database..Pls沒有影響幫助查詢確實運行但對數據庫沒有影響

+0

檢查什麼是你$臨時varible – LOKESH

+0

什麼是' $ temp'的價值? – RubahMalam

+0

$ temp ='2015-11-14 12:08:51 pm' –

回答

0
$query="DELETE FROM resit 
WHERE resitid=".$temp; 
+0

此代碼替換您的查詢 – jay

+0

它仍然無法正常工作... –

+2

'$ query =「DELETE FROM resit WHERE resitid ='$ temp'」;'和'$ query =「DELETE FROM resit WHERE resitid =「。$ temp;'? –

0

嘗試:

$query = "DELETE FROM reset WHERE resetid='".$temp."'"); 

希望這有助於

蘇海爾

+0

我可以建議您將變量名稱從'$ temp'更改爲其他名稱,因爲這可能是一個可能造成混淆的保留字。 –

相關問題