問題出在這裏。我有一個準備好的聲明,像這樣:多個預處理語句的問題
$select_something = $db->stmt_init();
$select_something->prepare ("
SELECT whatever
FROM table
");
$select_something->execute();
$select_something->bind_result($whatever);
當獨自一人 - 它的工作。當它在執行後添加另一個時,它也可以工作。 但是當我嘗試只是先準備他們兩個:
$select_something = $db->stmt_init();
$select_something->prepare ("
SELECT whatever
FROM table
");
後來就執行它們:
$select_something->execute();
$select_something->bind_result($whatever);
的第一條語句被執行,而第二個引發此錯誤上面兩條線:
*警告:mysqli_stmt ::執行()[mysqli的-stmt.execute]:無效的對象或資源mysqli_stmt *
注意,語句被命名爲二無論如何($ select_something和$ select_something_else),我只是認爲這是不必要的重複代碼。
謝謝!
請使[代碼示例完整](http://sscce.org/)以及簡潔。 – outis 2011-02-18 09:39:11