ic3d
05-18-2007, 08:56 PM
Hi Everyone,
My English is not very well but i'll try to explain what iam looking for.
I have an array in PHP with about 10 different numeric values between 10 and 99. E.g. $array[0] = 17; $array[1] = 41; and so on. I want to compare this array with the first two characters of a row in a database. For example 41210 should match because 41 is in the array in PHP. But 17210 should match as well.
Is there any way to do this? Iam at the very basic sql-statement now but can't find what to do next.
mysql_query("SELECT * FROM table WHERE the_first_two_chars_of_zipcode = '$everything_in_this_array'");
My English is not very well but i'll try to explain what iam looking for.
I have an array in PHP with about 10 different numeric values between 10 and 99. E.g. $array[0] = 17; $array[1] = 41; and so on. I want to compare this array with the first two characters of a row in a database. For example 41210 should match because 41 is in the array in PHP. But 17210 should match as well.
Is there any way to do this? Iam at the very basic sql-statement now but can't find what to do next.
mysql_query("SELECT * FROM table WHERE the_first_two_chars_of_zipcode = '$everything_in_this_array'");
