因此,我正在做这个项目,并且我正在使用的INSERT查询之一似乎出现故障。我在同一个项目上有其他INSERT查询,所以我不确定问题是什么。这是故障的查询。转储错误没有任何结果,但没有行受到影响。PHP PDO插入查询失败
$qry3 = $conn->prepare("INSERT INTO usermovie(user,movie) VALUES(:user, :filmid)");
$qry3->bindParam(':user',$user,PDO::PARAM_STR,16);
$qry3->bindParam(':filmid',$film,PDO::PARAM_INT);
$qry3->execute(); //usermovie, user and movie are the correct names for the table and columns.
为了便于比较,在同一个项目中插入查询不起作用,并创建一个新条目。
$qry2 = $conn->prepare("INSERT INTO users(userid,userpass,email,credits) VALUES(:username, :password, :email,0)");
$qry2->bindParam(':username', $nusername, PDO::PARAM_STR, 16);
$qry2->bindParam(':password', $npassword, PDO::PARAM_STR, 16);
$qry2->bindParam(':email', $nemail, PDO::PARAM_STR, 16);
$qry2->execute();
编辑:看来解决方案没有任何与此,在服务器更新脚本错误,并使用旧版本的故障,所以这是没有问题的。 我想这个问题可以删除。
可能重复的[如何挤出PDO错误信息?](http://stackoverflow.com/questions/3726505/how-to-squeeze-error-message-out-of-pdo) –