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