1

这是我的字符串

$mystring = "INSERT INTO `glpi_networkports` (`entities_id`,`is_recursive`,`items_id`,`itemtype`,`comment`,`logical_number`,`name`,`networkinterfaces_id`,`ip`,`mac`,`netmask`,`gateway`,`subnet`,`netpoints_id`)"

我怎么能忽略逃跑?

因为它给了我这样的字符串:

INSERT INTO glpi_networkports (entities_id,is_recursive,items_id,itemtype,comment,logical_number,
ame,
etworkinterfaces_id,ip,mac,
etmask,gateway,subnet,
etpoints_id)

谢谢

4

2 回答 2

5

当前,您的 select 语句已更改,因为您使用了双引号字符串,并且 `n 扩展为新行,将 select 变为无效语句。

使用单引号来维护反引号并禁用字符串扩展。

于 2013-07-18T10:44:16.160 回答
4

使用引号或加倍转义字符:

$mystring = "INSERT INTO 'glpi_networkports' ..."
$mystring = "INSERT INTO ``glpi_networkports`` ...
于 2013-07-18T10:36:46.640 回答