In phpMyAdmin, there is a search in database feature by which I can input a word and find it in any table(s).
How to implement it by SQL statement? I know the LIKE operation, but it’s syntax is:
WHERE column_name LIKE pattern
How to search in all columns? Any how to specify it’s a exact keyword or regular express?
Where search_box_text is what you enter in the search. It will also say in the result page what kind of query it made. The same query with regular expressions is:
Remember that the wildcard in mysql is %. Eg. “LIKE ‘%partial_search_text%’
If you want to search in multiple columns, you can check which columns are in table with:
Or if you already know your columns: