Javascript 对JSON字符串中编码的结果使用WHERE LIKE
想知道是否可以对JSON编码的sql表结果进行查询 我有一个表值,如下所示:Javascript 对JSON字符串中编码的结果使用WHERE LIKE,javascript,php,mysql,sql,json,Javascript,Php,Mysql,Sql,Json,想知道是否可以对JSON编码的sql表结果进行查询 我有一个表值,如下所示: column name: keywords column result: ["furniture","home furnishings","opening sale","home furnitures","sale and promotions"] 所以我在看 $query="SELECT * FROM table WHERE keywords LIKE '%home%' AND keywords LIKE '%f
column name: keywords
column result: ["furniture","home furnishings","opening sale","home furnitures","sale and promotions"]
所以我在看
$query="SELECT * FROM table WHERE keywords LIKE '%home%' AND keywords LIKE '%furnitures%'";
可能吗?我尝试了一个查询,但显示的结果并不准确。您的查询将正常工作,因为
%home%
和%furnitures%
都将匹配您的JSON字符串。你还没说准确度有什么问题。@Mike W哦,好的。谢谢,迈克,我知道了。这是一个错误,在我的查询,实际上成本的不准确。