$condition = '200,310'; //these are numbers of pages for news to be driven out of
while (list($key,$nesto) = each($pluginid))
{
$getnm = $DB->query("SELECT articleid, categoryid FROM " . TABLE_PREFIX . "p".$nesto."_newy
WHERE lang = '$userlang'
AND settings > 0
**AND instr(categoryid, $condition)**
ORDER BY settings ASC, datecreated DESC");
$rows = $DB->get_num_rows($getnm);
}
此 instr
不工作。任何想法如何使它起作用? categoryid
包含一个数字。
最佳答案
如果你想检查 categoryid 是否是 $condition 中提供的任何一个,你必须切换参数的位置:
AND instr('$condition', categoryid) > 0
关于php - instr() 查询不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7877585/