|
|||
|
I'm new to ZF, and it's possible I've just overlooked what I need, but...
I want to do a query like: SELECT * FROM table WHERE column IN (value1, value2, ...) So far, I'm using Zend_Db_Adapter::query(). Thanks for any suggestions on how to do this - I feel like it shouldn't be that hard! ![]() |
|
|||
|
$options = array('host'=> 'localhost',
'username'=> 'username', 'password'=> 'pwd', 'dbname'=> 'test' ); $db = Zend_Db::factory('Pdo_Mysql', $options); $result = $db->query("your query"); echo $result->fieldname; or echo $result['fieldname']; |
|
|||
|
Thanks for that, but what I'm really looking for is how to use "in" specifically.
For some reason, query() doesn't seem to be returning any results, so I'm now using fetchAll(). So, the following returns all records for user 2: $sql = 'SELECT * FROM table WHERE user_id in (?)'; $result = $db->fetchAll($sql, 2); But I want all records for users 2, 3, and 4. |
![]() |
| Thread Tools | |
| Display Modes | |
|
|