How I can make a query with MySQL that checks if the value (string
Simple solutions:
By using INSTR
SELECT * FROM `table` WHERE INSTR(`column`, '{$needle}') > 0
By using LOCATE
SELECT * FROM `table` WHERE LOCATE('{$needle}','column') > 0
$haystack
) in a certain column contains certain data. Simple solutions:
By using INSTR
SELECT * FROM `table` WHERE INSTR(`column`, '{$needle}') > 0
By using LOCATE
SELECT * FROM `table` WHERE LOCATE('{$needle}','column') > 0
0 comments:
Post a Comment