Monday, 15 February 2010

mysql - Searching by multiple columns -



mysql - Searching by multiple columns -

i'm trying search using of 3 columns have in table. have 3 fields, user can search code, name or category

the query have

select code, name, number, category table name '%{namefield}%' or code '%{codefield}%' or category '%{categoryfield}%' order name asc

i tried fill 1 of fields query this:

select code, name, number, category table name '%%' or code '%dog_10%' or category '%%' order name asc

it didn't homecoming null value or anything, returned table , code not filtered.

should have used , instead of or?

mysql

No comments:

Post a Comment