Re: mysql error

From: Date: Mon, 06 Dec 2004 02:06:11 +0000
Subject: Re: mysql error
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-203549@lists.php.net to get a copy of this message
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" <rdkurth@directphp.com> To: <php-general@lists.php.net> 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:rdkurth@directphp.com
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php


« previous php.general (#203549) next »