因此,我正在做這個項目,並且我正在使用的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) –