![]() |
|
|
#1 |
|
Junior Member
Join Date: Jan 2005
Posts: 8
|
selecting * where zipcode in this array
I need to be able to do the following:
"select * where `field1` Like 'this value' AND `field2` LIKE 'this value' AND `field3` LIKE 'this value' AND `field4` LIKE 'any of the values in this array'" the problem I had was that I tried various AND/OR combinations but kept getting unwanted records. Like the value in field4 would be one of the values in the array but the values in say field1 or field two would not be the value in the field1 Like 'this value' part. i need to restrict the values to the given 'this value' part for all other fields and still get results for the field for in this array part. Can anyone help? Pleeeeaaassse? the array is an array in php and I want it to check the values in the array and if it exists in the array include it in the results as long as the other fields maintain there restrictions the array is in the form $array [0] => 'some value' [1] => 'somevalue' [2] => 'some value' etc.............. Last edited by AllenGarner : 01-18-2005 at 05:02 AM. |
|
|
|
|
|
#2 |
|
Junior Member
Join Date: Jan 2005
Posts: 8
|
Re: selecting * where zipcode in this array
This was as close as I could come to making sense of a query for this
however it doesn't work lol... anyone have any ideas? "SELECT * FROM `autos` WHERE `make` LIKE '" . $_POST['make'] . "' AND `model` LIKE '" . $_POST['model'] . "' AND `price` BETWEEN '" . $_POST['lowprice'] . "' AND '" . $_POST['hiprice'] . "' AND `condition` LIKE '" . $_POST['condition'] . "' HAVING `zip` in (" . $searchzips . ") ORDER BY `price`"; the last part after the having clause is an array variable containing a result set retrieved by a select statement with all the zipcodes within a certain radius of the given zip Last edited by AllenGarner : 01-18-2005 at 05:52 AM. |
|
|
|
|
|
#3 |
|
Junior Member
Join Date: Jan 2005
Posts: 8
|
Re: selecting * where zipcode in this array
I figured it out thanks anyway
|
|
|
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Search Array Column | KidGeek | SQL syntax | 1 | 10-20-2004 04:01 PM |