【发布时间】:2016-01-12 05:57:03
【问题描述】:
我有一个这样的数组:
$str = 'In My Cart : 11 12 items';
preg_match_all('!\d+!', $str, $matches);
print_r($matches); // output is two number: 11, 12
现在我想知道,如何将这个数组 $matches 传递给这个查询?
SELECT column_name(s)
FROM table_name
WHERE column_name IN ($matches); // actually I want something like this: IN (11, 12)
有什么解决办法吗?
【问题讨论】: