插入DB时出现意外的T_VARIABLE错误

时间:2017-07-10 14:21:14

标签: php sql

HTML表单连接到数据库错误显示ob插入PHP文件中的表行代码:

await

错误消息是:

$sql = "INSERT INTO clients_info 
(Name,Organisation,Contact,Email,Services_Vertical,Comments) VALUES 
("$name","$organisation",$contact,"$email","$service","$comment")";

1 个答案:

答案 0 :(得分:1)

正如@sirko所提到的,你的引号不正确。见下文:

 <?php

 $sql= "INSERT INTO clients_info (Name,Organisation,Contact,Email,Services_Vertical,Comments) VALUES ('".$name."','".$organisation."','".$contact."','".$email."','".$service."','".$comment."')";

 ?>