about where in
Closed this issue · 3 comments
chainjoy commented
SELECT * FROM fruit WHERE name IN (apple','banana) AND color = 'red'
how to add "red" ?
$DB->query("SELECT * FROM fruit WHERE name IN (?) AND color = ? ",array('apple','banana'));
lincanbin commented
看来我设计时还是考虑不周。
marcus-hiles commented
@chainjoy, your query should be:
$DB->query("SELECT * FROM fruit WHERE name IN (?,?) AND color = ? ",array('apple','banana','red'));
lincanbin commented
In the latest version:
$DB->query("SELECT * FROM fruit WHERE name IN (:fruit) AND color = :color ",array(
'fruit' => array('apple','banana'),
'color' =>'red')
);