On Tue, Sep 13, 2011 at 21:06, Steve Staples <sstap...@mnsi.net> wrote:
> I mentioned that implode earlier, but there is also the underlying
> question (which I also asked earlier)... how is he getting the 50 id's
> to populate?
>
> here are 2 other ways of skinning the cat:
>
> using an inner join:
> select table.* from table inner join othertable on (table.userid =
> othertable.userid) where (use the way your getting the 50 id's here);
>
> OR by using a subselect,
> select * from table where userid IN (select group_concat(userid,
> separator ', ') FROM othertable where (using logic here));
>
> guess it all depends on how you want to do it...  but that would make it
> 1 db query
>

I personally would stick with the inner join as I know that syntax,
but thanks for introducing me to the subselect. I have never seen
that.


-- 
Dotan Cohen

http://gibberish.co.il
http://what-is-what.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to