Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在下面有 mySql 语句。
$sql = "INSERT INTO `myTbl`.uploads('id','name','group') VALUES (:id,:user,:group)"; $result = $db->prepare($sql);
GROUP 是 mySql 中的保留命令。我怎样才能逃避这个,以便我可以执行我的准备语句?
谢谢。
columnNames 和 tableNames 等标识符不应使用单引号,而应使用反引号。用单引号括起来会将标识符转换为字符串文字。
INSERT INTO myTbl.uploads(id, name, `group`) VALUES (:id,:user,:group)