在MySQL中,我使用PHP的json_encode将数据存储在“jsonValue”字段中:
{"product_category":[[{"category":["28"]},{"product":["16","22","64"]}]]}
通过PHP,我希望通过编写以下查询来获取数据:
SELECT * FROM `dbTable`
WHERE JSON_CONTAINS(jsonValues, '"category":["28"]');
但是,它还是报错:
3141 - Invalid JSON text in argument 2 to function json_contains: "The document root must not follow by other values." at position 10.