I've been trying to figure out how I can make a query with MySQL that checks if the value (string $haystack
) in a certain column contains certain data (string $needle
), like this:
(我一直在尝试找出如何使用MySQL进行查询,以检查某个列中的值(字符串$haystack
)是否包含某些数据(字符串$needle
),如下所示:)
mysql_query("
SELECT *
FROM `table`
WHERE `column`.contains('{$needle}')
");
In PHP, the function is called substr($haystack, $needle)
, so maybe:
(在PHP中,该函数称为substr($haystack, $needle)
,所以也许:)
WHERE substr(`column`, '{$needle}')=1
ask by arik translate from so 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…