0
我用xampp在localhost中製作了一個網站。 現在我把它放在一臺服務器上,沒有任何工作了。bind_result mysqli不工作
本地主機:
$on124 = $mysqli_link->prepare("select * from online where ip=? order by id desc LIMIT 1");
$on124->bind_param('s', $ip);
$on124->execute();
$result_on124 = $on124->get_result();
$sb4154 = $result_on124->num_rows;
$on124->close();
get_result不工作,所以我讀,我需要改變bind_result:
$on124 = $mysqli_link->prepare("select id, ip, hora from online where ip = ? order by id desc LIMIT 1");
$on124->bind_param('s', $ip);
$on124->execute();
$result_on124 = $on124->bind_result($id, $ip, $hora);
$sb4154 = $result_on124->num_rows;
$on124->close();
,但它給了我這樣的:
error: Warning: mysqli_stmt::bind_result() [mysqli-stmt.bind-result]: Number of bind variables doesn't match number of fields in prepared statement.
什麼是錯的?
謝謝你的回答!我現在就試試吧! –
筆記,我編輯它提供了完整的東西澄清 – nomistic
它是完美的,謝謝!我可以使用select * from ...嗎? bind_result需要有變量或可以爲空? (如:bind_result();)再次感謝您 –