1

I want to search all fields from tables​​ tblproduct in MySQL database a given string, possibly using syntax as:

SELECT * FROM tblproduct WHERE * LIKE '%textbox%'

Is it possible to do something like this?

Marc Delisle
  • 8,879
  • 3
  • 29
  • 29
Mengky Chen
  • 63
  • 2
  • 10

1 Answers1

6

Try this..

concate fields to search whole table

Select * from tblproduct  where Concat(field1, '', field2, '', fieldn) like "%textbox%"

or

Using MATCH and AGAINST in mysql

SELECT * FROM tblproduct  WHERE MATCH (field1, field2, field3) AGAINST ('textbox')
Deenadhayalan Manoharan
  • 5,436
  • 14
  • 30
  • 50