【发布时间】:2015-01-29 23:00:56
【问题描述】:
我收到了 SQLSTATE[HY093] 错误,但我似乎无法找到它的来源。我正在尝试使用表单的参数向数据库表中插入一行。
我已经回显了表单中的所有参数,它们都在正常工作和显示。
$q = "INSERT INTO members (mid, firstname, lastname, username, password, email, phone, street, location, gender, ccnumber, expirymonth, expiryyear) VALUES (NULL, :firstName, :lastName, :username, :password, :email, :phone, :street, :location, :gender, :ccnumber, :expmonth, :expyear);";
$query = $dbConnect->prepare($q);
$enc_password = crypt($password,$username);
//echo 'It is: '.$enc_password.' ';
//echo 'It is: '.$lastName.' ';
$query->bindParam(":firstname",$firstName);
$query->bindParam(":lastname",$lastName);
$query->bindParam(":username",$username);
$query->bindParam(":password",$enc_password);
$query->bindParam(":email",$email);
$query->bindParam(":phone",$phone);
$query->bindParam(":street",$street);
$query->bindParam(":location",$location);
$query->bindParam(":gender",$gender);
$query->bindParam(":ccnumber",$ccnumber);
$query->bindParam(":expirymonth",$expmonth);
$query->bindParam(":expiryyear",$expyear);
//$query->debugDumpParams();
$result = $query->execute();
return $result;
提前致谢:)!
【问题讨论】:
-
我在下面的回答有帮助吗?