更新时间:2023-02-22 20:19:08
您正在使用$conn->
,就像使用$db
进行连接一样,因此下面的代码段
You are using $conn->
where as you are using $db
for connection so the below snippet
$conn ->prepare($query);
应写为
$db->prepare($query);
此外,您从哪里获得的$exception
?您的catch
语句应类似于
Also, where did you got $exception
from? Your catch
statement should look like
catch(PDOException $exception) {
}