What is the topic of interest, is it possible and if so how to search the database with a variable in the sql query so that you can use only one search-box, or you can insert the sql query in the button without the injection

  • Can you formulate the question more correctly? - madfan41k
  • @ madfan41k, I need to execute a query on searching the type SELECT * FROM baze WHERE id LIKE '% $ val%', I know how to do for one column, but I would like it to look for the entire table - Elanyl
  • where id like '% $ val%' or name like '% $ val%' or field3 like '% $ val%' - Tony DM
  • @Tony DM% LIKE% does not use an index, and if it is still used on several columns, then this is just a perversion - madfan41k
  • @TonyDM, that is, roughly speaking, to sort through or all the columns - Elanyl

1 answer 1

To implement this functionality, you must use the full-text search.

 SELECT name, description FROM table WHERE MATCH (row_1, row_n) AGAINST ('search text');