Displaying 1 result from an estimated 1 matches for "get_zipcodes".
2008 Mar 14
2
MySQL IN clause for an array of strings
I''m trying (for the first time) to build an IN clause from an array of
strings and getting an error using MySQL as the DB...
Here''s the code I''m using to build the clause:
zips_clause = ''''
user.get_zipcodes.each {|z|
zips_clause += '','' if !zips_clause.blank?
zips_clause += ''\'''' + z + ''\'''' # wrap string in single-quotes
}
zips_clause = ''('' + zips_clause + '')''
conditions = sanitize_...