MySQL search a text from two columns
- by I Like PHP
i have a table (tbl_world) which look like this
id | first_name | last_name | age | class |
now i want to search the text which can be anywhere in first_name or in last_name
i m using below mysql query
"SELECT * FROM tbl_world WHERE REGEXP '".$word."' IN( first_name, last_name)";
where $word is user input (means if i search 'hell' then 'hello' as well as 'wellhell' also returned in result)
above query display error, please suggest me optimize method for search in mysql.
addition question: should i use LIKR or RLIKE?