gpt4 book ai didi

php - 当单元格包含更多以逗号分隔的多值时如何显示数据

转载 作者:行者123 更新时间:2023-11-30 23:25:23 26 4
gpt4 key购买 nike

我有以下代码,但我遇到了问题。

$query = "SELECT p.*,(TO_DAYS(p.start_date) - TO_DAYS(NOW())) AS daydiff FROM #__jblance_project p ".
"WHERE p.status=".$db->quote('COM_JBLANCE_OPEN')." AND p.approved=1 AND '$now' > p.start_date AND p.id_category=202 ".
"ORDER BY p.is_featured DESC, p.id DESC ".

问题是当字段 id_category 有多个值时

202,203,204

虽然我已经将代码更改为

但它没有显示任何结果
AND  p.id_category=202 OR .id_category=203 OR .id_category=204

因为单元格包含所有用逗号分隔的值

任何建议。

谢谢D.

最佳答案

$query = "SELECT p.*,(TO_DAYS(p.start_date) - TO_DAYS(NOW())) AS daydiff FROM #__jblance_project as p ". "WHERE p.status=".$db->quote('COM_JBLANCE_OPEN')." AND p.approved=1 AND '$now' > p.start_date AND p.id_category=202 ". "ORDER BY p.is_featured DESC, p.id DESC ".

添加为 FROM #__jblance_project as p

关于php - 当单元格包含更多以逗号分隔的多值时如何显示数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13605508/

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