0

我正在开发一个互联网站点,使用 php 5.3 和 mysql 作为数据库。

使用数据库时,后面的行如:

...

  $stmnt = $mysqli->prepare("Select ID from users where loginid = ?");
    $stmnt->bind_param('i', $x);
    $stmnt->execute();
    $result = $stmnt->get_result();

是否有任何等效的命令:$stmnt->get_result();

这是因为我正在使用 phplint ( http://www.icosaedro.it/phplint/phplint-on-line.html ) 并且我收到编译错误:错误:方法 mysqli_stmt::get_result() 不存在

一些 workarround 得出的结论是某些服务器不支持 $stmnt->get_result() (否则,我不知道为什么无法编译代码)。

有没有相当于$stmnt->get_result()

谢谢 :)

4

1 回答 1

-1

可能

$stmt->fetch();

或者

$result = $result->fetch_assoc();
于 2013-05-21T19:35:04.887 回答