I know this question has been asked before. But nothing seems to work for me.
So I have this code below. What I am trying to do is Search in a database for table product_description and get the column name (this part so far works).The column name's collation is utf8_general_ci
$SearchWord1 = "Squirl";
$ExistingWord1 = "Banana";
$ReplacerWord1 = "Orange";
I have 3 products:
name: SQUIRL banana pie
name: Squirl BANANA pie
name: SQUIRL banana pie
I want to search for Squirl,the search should grab both Squirl and SQUIRL.
The same goes for banana $ExistingWord1 which is Banana and should also search for BANANA
$sql1 = "UPDATE product_description SET name = REPLACE(name, '$ExistingWord1', '$ReplacerWord1') WHERE name LIKE '%$SearchWord1%';";
if ($conn->query($sql1) === TRUE) {
echo "<h1>Everything worked as planned</h1>";
} else {
echo "Error updating record: " . $conn->error;
}
I read several posts on stackoverflow and nothing helped me thus far.