on the search_results page, what happens is:
-i use explode() to break the comma-delimited string down into array elements, and count() to count the number of array elements
-then i use a for loop to cycle through the list of array elements and run a sql query to search through a table for any matches to a particular array element. the for loop looks like


//for loop that cycles through elements in an array, and searching through a mys
ql table for matches
for($j=0; $j<$count_elements; $j++)
{$sql.="and columnname like '%keywords[$j]%' or columnname2 like '%keywords[$j]'
or columnname3 like '%keywords[$j]%'...'";}


i think this is technically working, since it's not giving me any errors, however it basically slows down searches to the point of unusability.

If you are using MySQL, look into FULL TEXT searches. MySQL 4 also has a binary mode which is pretty good. Make sure you've indexed your columns as well.
Larry



-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to