writing a MySQL search function
| From: | John Corry | Date: | Wed, 30 Aug 2000 04:18:58 +0000 |
| Subject: | writing a MySQL search function | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-14308@lists.php.net to get a copy of this message | ||
I have a 13 column MySQL table...
Writing from a form to the DB is no problem...
Printing the results to an HTML table, according to a query string appended
URL, is also done already...
So, now I can basically write links+query strings into my web pages that
will return results from a database. Basic, yes...but a decent first step
for someone who couldn't even conceive of it a week ago.
Now, what I really need to do is modify the .php file that displays the
results, so that I can pass the necessary query variables via a search form.
I need to be able to search by all or one or none (or any combination) of, I
guess 4-5 fields from the db...
How do you write the query? I'm thinking that the query has to be
dynamically generated...but can't really picture it beyond that. If you know
of any code snippets, articles or tutorials that cover this sort of thing,
I'd really appreciate it. I think once I get an idea of how the function
works, I'll be able to actually write it...
thanks,
John Corry
Neon Cowboy Design
http://www.neoncowboy.com