MySQL数据库没有使用php处理从表单更新

时间:2012-11-03 17:20:07

标签: 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, 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错误。

这是要插入此数据库MQL columns

错误报告采用PDO try catch:

的形式
catch(PDOException $e)
    {
    echo $e->getMessage();
    }

尽管它看起来好像工作正常,但数据库似乎无法接收更新。 :/

1 个答案:

答案 0 :(得分:5)

根据您的数据库结构截图,table name is memberyou used members进入your insert query