2009年2月3日星期二

Re: [fw-db] $select->where with array

try this:

$select->whre("id in (?)", $ids);

regards,

On Tue, Feb 3, 2009 at 14:26, PHPScriptor <contact@phpscriptor.com> wrote:
>
> Hello,
>
> I have an array with id's. So I want to select all those id's from a tabble.
> Is this possible.
> A little code:
>
> $ids = array(5,7,15,12,27);
>
> $model = new TestModel();
> $select = $model->select();
> $select->where('id = ?', $ids); // this is not working
>
>
> I want to get SELECT * FROM tblTest WHERE id = 5 OR id = 7 OR id = 15 ...
>
> Is this possible to do on a short way like I want?
>
>
> -----
> visit my website at http://www.phpscriptor.com/ http://www.phpscriptor.com/
> --
> View this message in context: http://www.nabble.com/%24select-%3Ewhere-with-array-tp21809885p21809885.html
> Sent from the Zend DB mailing list archive at Nabble.com.
>
>

--
Paweł Chuchmała
pawel.chuchmala at gmail dot com

没有评论: