你好,請幫我出關於此功能查詢執行錯誤檢查
function delete($serviceid)
{
$result = $this->query=("delete from service where service_id='$serviceid'");
$exe=$this->executeNonQuery();
if ($exe){
return $success = "Record deleted successfully.";
} else {
return $error = "Unable to process at this time.";
}
}
$ EXE始終是1,即使記錄不會被刪除的可能B,因爲它的,它只是檢查被執行的查詢或不,我怎麼能檢查記錄被刪除,則表明成功的消息
什麼是'executeNonQuery'? – 2011-03-23 19:38:08
您需要提供更多信息。什麼是$ this->查詢?它使用內建的mysql函數嗎?你在使用PDO嗎?你在使用Mysqli嗎? – vicTROLLA 2011-03-23 19:38:42
方法名稱'executeNonQuery'似乎在少數Microsoft技術FWIW的數據庫適配器中使用。我在Google中發現了一個*可怕的*示例PHP數據庫適配器。我希望這不是在這裏使用的。 – Charles 2011-03-23 19:41:32