我的問題是,如何刪除錯誤,消息說錯誤處理():提供的參數不是一個有效的MySQL結果
mysql_fetch_object(): supplied argument is not a valid MySQL result.
我需要拋出/捕獲這種錯誤,但不確定如何做到這一點。
當此函數返回結果時,它正常工作。
只是當結果返回null時,它表示提供的參數不是有效的mysql結果。
那麼我該如何刪除這個錯誤,所以當它沒有任何返回時,而不是顯示mysql_fetch_object(): supplied argument is not a valid MySQL result
時,它會向用戶顯示我想要的。
$posts = show_allgroupsposts1($myusers,5);
if (count($posts)){
do a bunch of stuff.
}else{
nothing to display.
}
?>
目前,它返回:
mysql_fetch_object(): supplied argument is not a valid MySQL result
nothing to display.
執行MySQL查詢不正確。我們不能診斷更多,直到你展示它。 – zerkms
可能的重複[Warning:mysql_fetch_array():提供的參數不是有效的MySQL結果](http://stackoverflow.com/questions/795746/warning-mysql-fetch-array-supplied-argument-is-not-a -valid-mysql-result) – Fluffeh
[Warning:mysql_fetch_ *期望參數1是資源,布爾給定錯誤]的可能的重複(http://stackoverflow.com/questions/11674312/warning-mysql-fetch-expects-parameter- 1-to-resource-boolean-given-error) – DCoder