noncent / pdo_class_wrapper

A Class for PDO Wrapper
25 stars 21 forks source link

SQL IN operator #7

Closed milantrax closed 8 years ago

milantrax commented 9 years ago

Is it possible something like this, with IN operator: SELECT * FROM Customers WHERE City IN ('Paris','London'); Thanks

noncent commented 9 years ago

Hi Milantrax,

Yes, you can use IN like below sample code with pdoQuery:


/**
 *  Query with IN operator 
 */
$q = $db->pdoQuery('SELECT * FROM Customers WHERE City IN (?, ?);',array('Paris','London'))->showQuery()->results();
// print array result
$helper->PA($q); 

Sorry for any mistake's actually I am out for my weekend, so its just quick reply by my cell phone.

Cheers!!!