php - Error in large MySql Query -


i trying use following mysql query, returns syntax error @ 'where find_in_set('query', alternate_name)' @ line 3. i've tried googling , looking through mysql manual, can't seem find how fix it.

query:

select name, 'events' source feed_events name '".$query."%' union     select name, 'venues' source feed_venues name '".$query."%' union select name, 'locations' source feed_locations name '".$query."%' or find_in_set('".$query."', alternate_name) 

in select statement having problem, trying select names of cities best fit string user has inputted ($query). in first column city name , in second column have comma separated list of alternative names city. find_in_set() supposed search items in column find best match. there way fix syntax error, or find_in_set() not ideal choice trying do?

you don't need second where keyword. can have 2 things in or this

where expression1 or expression2 

for instance:

where field = '1' or field = '2' 

Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -