hope this help

// array of zip codes
$zips = array(...);

// can use implode() here if you want
foreach($zips as $zip) {
    $zip_list = ",'".$zip."'";
}

// take away the first comma
$zip_list = substr( $zip_list, 1);

$sql = "SELECT stores FROM store_table WHERE zip_code IN('$zip_list')";

$hdl = mysql_query($hdl);


Foong


Kelly Meeks <[EMAIL PROTECTED]> wrote in message
009c01c2bbf5$03496b00$6901a8c0@yourw92p4bhlzg">news:009c01c2bbf5$03496b00$6901a8c0@yourw92p4bhlzg...
I've got an array of values, that I need to query against a database to see
if any records have any of the values in the array - the array is a list of
zip codes, and the database contains a list of stores.  Basically i need to
find what stores have zip codes in the array.

I know that mysql doesn't support subquerys - is there a workaround for this
kind of scenario?

TIA,

Kelly




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

Reply via email to