2
我有我的代碼錯誤有人可以幫我嗎?mysqli bind_param()致命錯誤
<?php
$db = new mysqli("localhost","root","","karmintalender");
$owner_ID = 1;
$sql = "SELECT name, kalender_ID FROM kalender WHERE ersteller_ID = ?";
$stmt = $db->prepare($sql);
$stmt->bind_param("i", $owner_ID);
$stmt->execute();
$stmt->bind_results($name, $kalender_ID);
while ($stmt->fetch()) {
echo $name . " " . $kalender_ID;
}
?>
當我打開它顯示該錯誤 「致命錯誤:調用一個成員函數bind_param()G中的非對象:\ XAMPP \ htdocs中\ Karmintalender \ test.php的第8行」
權領域kalender_ID不存在我現在編輯它還有另外一個錯誤「致命錯誤:調用未定義的方法mysqli_stmt :: bind_results()在G:\ XAMPP \ htdocs中\ Karmintalender \ test.php on line 11「 –
http://php.net/manual/en/mysqli-stmt.bind-result.php檢出文檔。 – Eddie
好吧謝謝了:) –