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:

  1. in $value there eggs, in mysql-db there egg, should still return $error = true;
  2. 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

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -