I ' vebeentryingtofigureouthowicanmakeaquerywithmysqlthatchecksifthevalue (string $ haystack ) inacertaincolumncontainscertataion
mysql_query ('
选择*
从表
where ` column `.contains ({ $ needle } ) )
();
In PHP,thefunctioniscalledsubstr ($ haystack,$needle ),so maybe:
WHERE substr(`column `,' {$needle} ' )=1
Quite simple actually:
mysql_query ('
选择*
从表
WHERE `column` LIKE '%{$needle}% '
();
the % isawildcardforanycharactersset (none,one or many ).donotethatthiscangetslowonverylargedatasetsssoifyourdatabasegrowsegrowsyowsyoyograteted