How can I search all columns in a table?

SELECT ...
FROM yourtable
WHERE 'val' IN (field1, field2, field3, field4, ...)

if you’re looking for exact full-field matches. If you’re looking for substring matches, you’ll have to go about it the long way:

WHERE field1 LIKE '%val%' or field2 LIKE '%val%' etc....

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)