Re: Querying a database for 50 users' information: 50 queries or a WHERE array?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Sep 13, 2011 at 7:29 AM, Ashley Sheridan
<ash@xxxxxxxxxxxxxxxxxxxx>wrote:

> SELECT * FROM table WHERE userID IN (1,2,3,4,5,etc)
>

+1. And this is a great place to use implode():

    $sql = 'select ... where userID in (' . implode(',', $ids) . ')';

David

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux