当我尝试和我的数据库运行此查询:PHP的SQL命令只是清除数据库表?
$mysqli->query("UPDATE
catalogsearch_fulltext
SET data_index = '".$unique_string."'
WHERE MATCH(data_index) AGAINST ('".$savestring."')
AND store_id = '1'");
它不但不工作,但它会清除我的整个catalogsearch_fulltext
表。我究竟做错了什么?我对SQL有些陌生,所以希望有人能够发现一个快速错误。
如果需要,我可以提供更多的代码,但我认为它不适用。
谢谢!
编辑:
$unique_string = "325-FBA-BA-0006-x3|Badger|Enabled|Taxable Goods|Badger - SPF 30+ Anti-Bug Sunscreen, 2.9oz. - (Pack of 3)|47300|You asked, and Badger listened! After receiving many requests for a totally natural combination bug repellent and sunscreen, Badger took their wildly popular SPF 30+ Sunscreen formula and combined it with their Anti-Bug Balm formula to create easy-to-apply, safe, and natural protection for the whole family!|43.35|1"
$string = "the same as above but with duplicat entries in the | Pipe | sections."
这也是值得注意的是,这个查询是一个循环,经过约6条去。
$ unique_string和$ savestring的值是多少? – kieran
$ unique_string和$ savestring非常长,但我会将它们的值添加到文章 –
更新不应该删除记录,除非您有一个奇怪的外键设置或某种注入漏洞。 –