gpt4 book ai didi

php - 在格式为 json 的字段中选择多个 ID

转载 作者:太空宇宙 更新时间:2023-11-03 11:08:20 26 4
gpt4 key购买 nike

如何对多个格式为 JSON 的 ID 进行选择?

$query = 'SELECT * FROM articles as a WHERE "10" IN (a.catids)';

The value of a.catids in the db-field is {"0":"10","1":"12"};

最佳答案

类似于:

$query = 'SELECT * FROM articles as a WHERE a.catids like '%:"10",%';

我包括了 : 和 ,所以你确定你选择的是值而不是索引

关于php - 在格式为 json 的字段中选择多个 ID,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10285493/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com