php - MATCH AGAINST unknown column -


i have problems searching method, i'm using match against because it's better like. example have database full of cities , when type city name (for example moscow) in input field, there error "unknown column 'moscow' in 'where clause'". have 2 columns in database, city_id , city_name

enter image description here

my sql query looks this

"select city_name default_cities match(city_name) against($city)" 

if have suggestions i'll appreciated :)

"select city_name default_cities match(city_name) against('$city')" 

use quotes $city

edit

don't forget escape it. (for ex. "l'amour")


Comments

Popular posts from this blog

php - regexp cyrillic filename not matches -

c# - OpenXML hanging while writing elements -

sql - Select Query has unexpected multiple records (MS Access) -