RE: [PHP] php'ed mysql query
| From: | Sam Masiello | Date: | Tue, 16 Jan 2001 19:36:10 +0000 |
| Subject: | RE: [PHP] php'ed mysql query | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-34889@lists.php.net to get a copy of this message | ||
If you are going to do a comparison from one of the fields in your table,
doesn't the field name need to be on the left hand side of the comparison?
So instead of "where '$zip1' >= zip", shouldn't it be "zip <
'$zip1'" (et al
for the other comparisons in your query) .
HTH
Sam Masiello
Systems Analyst
Chek.Com
(716) 853-1362 x289
smasiello@chekinc.com
-----Original Message-----
From: Christopher Allen [mailto:callen@driver8.org]
Sent: Tuesday, January 16, 2001 2:25 PM
To: php
Subject: [PHP] php'ed mysql query
Hello,
Can anyone tell me why this query errors out? It works from the mysql
client command line just fine....
$query1 = "select * from zip_base where '$zip1' >= zip &&
'$zip1' <= CONCAT
(SUBSTRING(zip , '1' , LENGTH (zip) - LENGTH (range) ), range)";
Christopher C. M. Allen
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
For additional commands, e-mail: php-general-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net