RE: [PHP] Database search logic question
| From: | Graham Cossey | Date: | Mon, 15 Nov 2004 09:56:45 +0000 |
| Subject: | RE: [PHP] Database search logic question | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-202028@lists.php.net to get a copy of this message | ||
A couple of possibilities are:
Store search criteria (form entries) in MySQL
Store query string in MySQL
If the user has to log-in then the MySQL table would
be keyed on the user_id or similar.
If the user does not have to log-in then you will most
likely need to store something in a client-side cookie
that references the saved query details.
On one of my sites I allow users to either build a query
via a step-by-step procedure or manually enter a query
statement. It is the statement that I store in the
database together with a name they supply and their user
id. This allows the user to save multiple queries and
recall them at a later date by a name that they supplied.
HTH
Graham
> -----Original Message-----
> From: Stuart Felenstein [mailto:stuart4m@yahoo.com]
> Sent: 15 November 2004 09:10
> To: php-general@lists.php.net
> Subject: [PHP] Database search logic question
>
>
> For those who recognize this topic from me and perhaps
> are sick of it , my apologies :)
>
> This is actually a different question more about logic
> then syntax or functionality.
>
> One of the uses of my search form is that users may
> save their search parameters. Typical benefits, they
> don't have to re-enter all the criteria. Hitting one
> link or receiving an email can get them the results
> they need.
>
> The way I was approaching this was to grab the url,
> the part after the ? , so not the referer. Whatever
> the second part is called.
> Only now that I've created a search and results page
> via Post method, of course there is nothing going to
> the URL. I'm wondering at this point if I should
> create a way to let users save their search
> parameters, by grabbing the variables and storing them
> as an array in the database or go back to the URL
> method.
>
> Curious if anyone sees benefits or negatives with
> either.
>
> Stuart
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>