When I try and run this query on my database:
$mysqli->query("UPDATE
catalogsearch_fulltext
SET data_index = '".$unique_string."'
WHERE MATCH(data_index) AGAINST ('".$savestring."')
AND store_id = '1'");
It not only doesn’t work, but it clears my ENTIRE catalogsearch_fulltext table. What am I doing wrong? I’m somewhat new to SQL so this is hopefully a quick error someone can spot.
I can provide more code if requested, but I don’t think it is applicable.
Thanks!
Edit:
$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."
It is also worth noting that this query is in a loop that goes through about 6 records.
If $unique_string and $savestring were both uninitialised, I expect you would set your index column to null – which would result in them not showing up in any selects that use that index column?
Perhaps you meant $uniquestring and $save_string? or perhaps these variables are out of scope?