使用代码
# 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();
}
然而,尽管它看起来好像运行良好,但数据库似乎无法接收更新。:/