R
Rajat Garg
[Note: parts of this message were removed to make it a legal post.]
Hi Guys,
I am a newbie, so excuse me if this is a lame question -
I am writing a query -
Airport.findall, :conditions =>["owner_city_state_zip like '%?%'",
_tempZip.zip])
Now, this gives an error -
Mysql::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 '97103'%')' at line 1: SELECT * FROM airports WHERE
(owner_city_state_zip like '%'97103'%')
How do I format my query to get rid of this problem?
Also, how do we write a query to written say, 2 fields out of table instead
of all the fields.
Thx,
--
Rajat Garg
Ph: 206-499-9495
Add: 1314 Spring Street, #412
Seattle, WA 98104
Web: http://www.pilotoutlook.com
Hi Guys,
I am a newbie, so excuse me if this is a lame question -
I am writing a query -
Airport.findall, :conditions =>["owner_city_state_zip like '%?%'",
_tempZip.zip])
Now, this gives an error -
Mysql::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 '97103'%')' at line 1: SELECT * FROM airports WHERE
(owner_city_state_zip like '%'97103'%')
How do I format my query to get rid of this problem?
Also, how do we write a query to written say, 2 fields out of table instead
of all the fields.
Thx,
--
Rajat Garg
Ph: 206-499-9495
Add: 1314 Spring Street, #412
Seattle, WA 98104
Web: http://www.pilotoutlook.com