To reduce the time it takes to process it all you might want to try using LIKE 
in your queries. This means your script will only have to process say 50 
instead of 10 000 results. (Not saying your DB is this big).

For example:
SELECT page FROM table_name WHERE description LIKE '%$keyword%';

This is all off the top of my head so the syntax might be off a little.
Read some SQL documentation about LIKE for more information.


On Monday 17 November 2003 21:56, Dimitri Marshall wrote:
> Hello...
>
> I'm trying to make a search function for my site. This is how it needs to
> work:
>
> First, a user types in a search (ex: niagara falls). All the words then get
> seperated or stay together, depending on the what the user selects in the
> form. I can figure this out, all I have to do is use the explode() right?
>
> Second, this array needs to search against a description on the database.
> What I was thinking is getting the description ($description) and then
> exploding that into an array and then comparing all arrays against each
> other.
>
> I'm pretty sure there's a way easier way to do this. Could someone
> enligthin me?
>
> Greatly appreciate any help in advance,
> Dimitri Marshall

-- 
"I have a photographic memory. I just forgot the film" --Unknown
=============================
Ryan Thompson
[EMAIL PROTECTED]
http://osgw.sourceforge.net



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

Reply via email to