Try:

SELECT * FROM listing WHERE listing.state = 'WA' AND listing.type = 'RES' AND listing.county = 'clark' AND (listing.price > 150000 OR listing.price <=200000)

Try to not use the word "type". Do not know what it is but I have some problems using it. In the event you have weird problems, try putting the table name before the field like I did (i.e., listing.type). You probably also need the price in params since you want to OR just on those two items. I also assume that you have the price field as a int, bigint, or similar field type which does not require a tick around the value. I also dont think that the back tick works.

HTH

Travis

----- Original Message ----- From: "Richard Kurth" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, December 05, 2004 3:05 PM
Subject: [PHP] mysql error




Could somebody tell me way these query gets a error 1064 and does not
work.
error=You have an error in your SQL syntax; check the manual that corresponds to your
MySQL server version for the right syntax to use near
'"SELECT * FROM listing WHERE `state` = 'WA' AND `type` = 'RES'



query="SELECT * FROM listing WHERE `state` = 'WA' AND `type` = 'RES' AND `county` = 'clark' AND `price` > '150000' OR `price` <= '200000'";


-- Best regards, Richard mailto:[EMAIL PROTECTED]

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

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



Reply via email to