MySQL数据库未使用php处理从表单更新
使用代码MySQL数据库未使用php处理从表单更新,php,mysql,forms,sql-insert,Php,Mysql,Forms,Sql Insert,使用代码 # the data we want to insert $data = array($first_name, $last_name, $email_from, $telephone, $dateofbirth, $addresslone, $addressltwo, $townnm, $countynm, $typeapp, $issubscribed); $STH = $dbh->prepare("INSERT INTO members (fname, sname, emai
# the data we want to insert
$data = array($first_name, $last_name, $email_from, $telephone, $dateofbirth, $addresslone, $addressltwo, $townnm, $countynm, $typeapp, $issubscribed);
$STH = $dbh->prepare("INSERT INTO members (fname, sname, email, phone, dob, addressl1, addressl2, town, county, type, subscribed) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)");
$STH->execute($data);
?>
<!--<!DOCTYPE html>
<head><title></title></head><body> commented out during testing -->
Thank you for contacting us We will be in touch with you very soon.
<!-- </body></html> -->
尽管看起来它工作得很好,但数据库似乎无法接收更新/ 根据您的数据库结构截图,
表名为member
并且您使用了members
进入您的插入查询
根据您的数据库结构截图,表名为member
并且您使用了members
进入您的插入查询
谢谢;我失明了。一个字符的打字错误。。。ffs!谢谢我失明了。一个字符的打字错误。。。ffs!如果你没有的话,这种尝试/捕捉不会有多大作用。如果你没有的话,这种尝试/捕捉不会有多大作用。
catch(PDOException $e)
{
echo $e->getMessage();
}