PDA

View Full Version : Where clause with more than one column


Jacobb123
02-01-2008, 01:32 AM
How can I setup this query so that it pulls the info from both columns.

"SELECT * FROM blogs WHERE body or subject LIKE '%{$_GET['search_term']}%'"

Roelf
02-01-2008, 08:47 AM
tis should work:

"SELECT *
FROM blogs
WHERE body LIKE '%{$_GET['search_term']}%'
OR subject LIKE '%{$_GET['search_term']}%'"