-1
我试图检索单行以下功能:PHP得到以下错误:“致命错误:未捕获的异常‘PDOException’”
function get_registrar($key){
global $db;
$query = 'SELECT * FROM registration WHERE key = :key';
$statement = $db->prepare($query);
$statement->bindValue(':key', $key);
$statement->execute();
$result = $statement->fetch();
$statement->closeCursor();
return $result;
}
而且我不断收到“致命错误:未捕获的异常'PDOException'消息'SQLSTATE [42000]:“错误消息。任何想法,为什么这可能是?由于
感谢的名单,我改变了$关键的东西其他,但仍然得到错误。 – Richard
我可以在我的桌子上使用“钥匙”吗? – Richard
没有你不能使用你的表中的密钥或大写字母的名字,如果你使用你需要返回打勾..对于绑定变量它的好 –