I’m trying to make a search feature that will search multiple columns to find a keyword based match. This query:
SELECT title FROM pages LIKE %$query%;
works only for searching one column, I noticed separating column names with commas results in an error. So is it possible to search multiple columns in mysql?
You can use the AND or OR operators, depending on what you want the search to return.
Both clauses have to match for a record to be returned. Alternatively:
If either clause matches then the record will be returned.
For more about what you can do with MySQL SELECT queries, try the documentation.