0
<?php
$user=htmlspecialchars($_POST['user']);
$password=htmlspecialchars($_POST['password']);
$email=htmlspecialchars($_POST['email']);
//$number=htmlspecialchars($_POST['number']);
$quater=htmlspecialchars($_POST['quater']);
if (isset($user) && isset($password)&& isset($email) && isset($quater))
{
try{
$bdd = new PDO('mysql:host=localhost;dbname=library;charset=utf8', 'root', '');
}
catch(Exception $e)
{
die('Erreur : '.$e->getMessage());
}
$req = $bdd->prepare('INSERT INTO user(name, password, email, quater) VALUES(?,?,?,?)');
$req->execute(array('name'=> $user,'password'=>$password,'email'=>$email,'quater' => $quater));
}
else
{
echo "<p color=red >please fill all the fills above<p>";
}
?>
得到以下錯誤傾斜插入件插入用PHP插入數據的基礎上使用PDO
警告:PDOStatement對象::執行():SQLSTATE [HY093]:無效參數數:參數沒有被定義在[ ...}
它仍然給這些相同的糾錯它 –
後,什麼是你的代碼看起來像現在? – Qirel