Web Advertising - Magazine Subscriptions - Car Credit - Fast Loans - Mortgage

PDA

View Full Version : MySQL Searching Entire Tables


Kennedy
Feb 6th 2008, 10:32 pm
What would be a query for searching an entire database for a word or multiple words? Not just searching a single row. For example searching the "pagetitle" and "description" fields from the entire database for the words "clockwork orange".

The Critic
Feb 6th 2008, 10:55 pm
SELECT queries automatically search an entire table for the parameters in the WHERE clause unless you tell it not to by specifying a LIMIT.

Kennedy
Feb 6th 2008, 11:19 pm
I'm looking for something like this:

$query="SELECT * FROM vids WHERE desc LIKE '$q' || tags LIKE '$q'";

But that doesn't work.

CreativeClans
Feb 7th 2008, 2:54 am
$query="SELECT * FROM vids WHERE desc LIKE '%$q%' OR tags LIKE '%$q%'";