Re: SELECT problem..Need urgent help !!!!

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

 



On Mon, 29 Nov 2004 17:27:26 +0200, Phpu <phpu@xxxxx> wrote:
> I have an array named $ex_array.
> 
> I want to search the database and find those ids that are different from the values in $ex_array.
> 
> I use this but didn't work
> 
> $sql = "SELECT product_id FROM products WHERE product_id <> '$ex_array' " ;

$sql = "
SELECT
    product_id
FROM
    products
WHERE
    product_id NOT IN ( "
    . implode( ', ', $ex_array )
    . " ) ";

This question would be more appropriate for the php-db list.


-- 
Greg Donald
Zend Certified Engineer
http://gdconsultants.com/
http://destiney.com/

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


[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