RE: [PHP] Select IN array?

2001-07-14 Thread Chris Lott
> I have an array of id numbers ($catids). > This syntax fails: > select * from categories > where cid in $catids Never mind. I was being stupid. For the record, one needs to implode(",", $catids) and then use that in the WHERE statement, i.e. "where cid in ($catids)" c -- PHP General Mailin

[PHP] Select IN array?

2001-07-14 Thread Chris Lott
I have an array of id numbers ($catids). I would like to select from the mysql database all records where cid is in that array. This syntax fails: select * from categories where cid in $catids What is the correct way to do this? It can be done outside of a loop, can't it? c -- PHP General Mai