You can concat to the 1 filter statement the 2. ex:

SELECT * FROM atable WHERE (fieldname = fieldvalue) AND (fieldname2 =

For the user to search twice in the same field i think you have to use the
LIKE operator instead of the = and use the % in the string as wildcard. ex:

1 Search:  Name = "%Carlos%"        // Will return all Carlos
2 Search:  Name = "%Triana%"        // Will return everybody that have
Carlos and Triana in any part of their name if used a sql like the one above
(with AND).

This could be done how many times you want with only one field or several.

Hope this Hepls.

----- Original Message -----
From: "Lic. Carlos A. Triana Torres" <[EMAIL PROTECTED]>
Sent: Wednesday, February 18, 2004 1:36 PM
Subject: [PHP-DB] Search results of a previous query?

Hi all,
    I am trying to build a script to make "nested" searches in a table. I
have a form compossed of a text field and a select dropdown menu with all
the fields in the table. The user can write in the text box and then select
the field in which to perform the search. This works fine so, I
want to show the results of the query, but give the user the possibility of
searching again BUT only make the search with the results shown, not the
entire table....can anyone give me any ideas of how to do this last part? I
tried passing the new queries in the url...but this won't give the user the
possibility to search twice in the same field...
Any ideas? Thanks before hand.

PHP Database Mailing List (
To unsubscribe, visit:

Reply via email to