View Single Post
Old 09-12-2004, 01:50 PM   #5 (permalink)
Outpour
Upright
 
So to do the actual query would you do seperate queries for each term?

PHP Code:
//Let $_GET['q'] be the search terms
$search explode(" ",$_GET["q"]);
foreach (
$search as $term) {
   
$query "SELECT DISTINCT * FROM table WHERE field LIKE '%$term%' OR field2 LIKE '$term%' OR field3 LIKE '%$term%'";

Obviously that itself won't work.. $query would be over written each time the foreach loops. How would you do a query on all the terms and combine them into one large array?
__________________
Nihilism is the organic, reasoned response to artificial chaos, the intentional chaos manufactured by government, religion and mass-media.
Outpour is offline  
 

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46