插入通过method =“Post”

时间:2015-10-12 04:02:53

标签: php mysql mysqli

我正在设计一个页面,将宠物查找业务表单的数据发送到数据库,但我很难记住如何做到这一点,因为它已经有一段时间了,我还没有采用正式的PHP类。

我已经通过表单中的POST方法存储了发送到PHP文件的所有值,并在使用它们之前通过mysqli_real_escape_string()运行它们。

我的PHP查询行是

$save = "INSERT INTO requests (fName, lName, address, city, state, zip, pPhone, cPhone, email,
pName, species, gender, spayedNeutered, temperament, howLost, comments) VALUES ($fName,
$lName, $address, $city, $state, $zip, $pPhone, $cPhone, $email, $pName, $species, $gender,
$spayedNeutered, $temperament, $howLost, $comments)";

有人发现这条线有什么问题吗?

1 个答案:

答案 0 :(得分:0)

使用'作为值

$save = "INSERT INTO requests (fName, lName, address, city, state, zip, pPhone, cPhone, email,
pName, species, gender, spayedNeutered, temperament, howLost, comments) 

VALUES ('$fName',
'$lName', '$address', '$city', '$state',.
相关问题