我正在尝试使以下代码工作,但我无法到达该execute()
行。
$mysqli = $this->ConnectLowPrivileges();
echo 'Connected<br>';
$stmt = $mysqli->prepare("SELECT `name`, `lastname` FROM `tblStudents` WHERE `idStudent`=?");
echo 'Prepared and binding parameters<br>';
$stmt->bind_param('i', 2 );
echo 'Ready to execute<br>'
if ($stmt->execute()){
echo 'Executing..';
}
} else {
echo 'Error executing!';
}
mysqli_close($mysqli);
我得到的输出是:
Connected
Prepared and binding parameters
所以问题应该出在第 5 行,但是查看手册bind_param()
我找不到任何语法错误。