$ONEQuery = "SELECT * FROM table where column3 LIKE '$words'";
ACTUAL QUERY will be more like this:
"SELECT * FROM table where column3 LIKE '%$words%'";
Note the %, these are the wildcard symbols
As for this:
$words = split(" ", $words);
foreach($words as $wordsBrokenUp) {
$Query = "SELECT * FROM table where column3 LIKE '$wordsBrokenUp'";
You'd really want to create from your long target a string that looks like:
"SELECT * FROM table where
column3 LIKE '%$word1%'
OR column3 LIKE '%$word2%'
OR column3 LIKE '%$word3%'
OR column3 LIKE '%$word4%'";
As for this query:
$subQ = "SELECT * FROM table where column1 = ???
I have no clue what you mean to do here?
Maybe:
"SELECT * FROM table where
column1 = ???
AND (column3 LIKE '%$word1%'
OR column3 LIKE '%$word2%'
OR column3 LIKE '%$word3%'
OR column3 LIKE '%$word4%'");
Is that what you mean?