RE: [PHP] Finding array in MySQL (I'm not asking the right question)
| From: | Dave G | Date: | Wed, 03 Dec 2003 00:40:47 +0000 |
| Subject: | RE: [PHP] Finding array in MySQL (I'm not asking the right question) | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-171619@lists.php.net to get a copy of this message | ||
> Totally wrong ! It's always better to have maximum work done by MySQL
So does that mean that this:
> $countUser = count($arrayUser);
> for($i = 0; $i < $countUser; $i++){
> $sql = "SELECT email FROM table WHERE id = '" . $arrayUser[$i] .
> "' ";
> }
... is faster than this:
> "SELECT email FROM table WHERE id IN ('" .
> implode("','",$array) . "')";
... ?
--
Cheers!
Dave G
ml@autotelic.com