Need some ideas
| From: | Joseph Stein | Date: | Sun, 12 Nov 2000 05:12:57 +0000 |
| Subject: | Need some ideas | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-4382@lists.php.net to get a copy of this message | ||
I have been working on "upgrading" the search capability on my MySQL database.
Currently, I do an oversimplified search applied to multiple fields of the database using a really ugly SELECT statement that matches on the verbatim $search from the form.
What I want to do, (that won't simplify the select statement much), is to take a search string and tokenize it, and do several independant searches into temporary database(s) and pull the final results out of the last-created temporary database -- but am a little lost.
I think that this is what I want to do:
form is POSTed
tokenize $search
if this is the first time through the loop
create a temporary database with results from the first token of the search string
if this is an AND search
continue creating temporary databases from the first temp database
else
continue adding to the first temporary database
but I am unsure, based on information in the online manual about strtok(). Would using split() and the array-walking functions be better suited to this? Any ideas, anyone?
FWIW, I am using PHP4.0.3pl1 with Apache 1.3.14 and MySQL 3.23.26-beta.
Thanks in advance for any help.
joe