使用代码
# 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> -->
向用户显示成功消息:
感谢您与我们联系我们会尽快与您联系。
没有记录php错误。
这是要插入此数据库
错误报告采用PDO try catch:
的形式catch(PDOException $e)
{
echo $e->getMessage();
}
尽管它看起来好像工作正常,但数据库似乎无法接收更新。 :/
答案 0 :(得分:5)
根据您的数据库结构截图,table name is member
和you used members
进入your insert query