mysqli::error包含mysqli_stmt::error吗?如果在准备语句或执行语句时出现错误,myqli::error将包含该错误,还是该错误仅包含在mysqli_stmt::error中?
编辑:为了清楚起见,我正在尝试了解是否需要专门检查mysqli_stmt::error来处理和报告故障,或者是否可以始终使用mysqli::error而不会遗漏任何错误。
编辑2:如果错误是独立的,哪一个应该用于mysqli::stmt_init()故障?
发布于 2012-04-05 15:24:11
$mysqli = new mysqli('localhost', 'root', 'yabadaba', 'testdb');
$stmt = $mysqli->prepare('MESSUP(?'); //no error thrown
var_dump($mysqli->error); //... right syntax to use near 'MESSUP(?'尽管有一个Exception class --我似乎找不到任何真正抛出它的方法。看起来一切都在$mysqli->error中。
https://stackoverflow.com/questions/10022519
复制相似问题