php - Output $error = true if string contains value of mysql-database -
i have strings these in php,
"the quick brown fox eats yellow eggs" "another sentence" ...
as output of
foreach ($array &$value) { //$value = "the quick brown fox eats yellow eggs" or 1 }
then have mysql-database with
id,wort 1,fox 2,egg ...
i've tried
select wort table word lower('%".$value."%')";
goal determine amount of load neccessary within foreach-loop, whether $value contains wort of mysql-database. if yes, $error = true; else $error = false;
note:
- in $value there eggs, in mysql-db there egg, should still return $error = true;
- number of words in value should more number of wort in database.
try query:
"select word table locate(word, lower('".mysqli_real_escape_string($value)."')) <> 0 or locate(lower('".mysqli_real_escape_string($value)."'), word) <> 0"
Comments
Post a Comment