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();)再次感谢您 –