【发布时间】:2015-04-24 04:12:59
【问题描述】:
我的 php 代码抛出错误如下:
$stmt = $con->prepare('INSERT INTO listOfRides (address, time) VALUES
('$address', '$time')') ;
我查看了其他帖子,似乎我正确使用了变量,并在它们周围加上了单引号,但是在访问 URL 时显示以下错误:
Parse error: syntax error, unexpected T_VARIABLE in /home/gbidjght/public_html
/insertRide.php on line 79
感谢任何帮助
【问题讨论】:
-
为什么不使用占位符和 ->execute() 作为值?
标签: php mysql sql-insert