aply logic in the app. i. e. build the where clause from the 
filled in fields only:

$where = array() ;
foreach( $HTTP_GET_VARS as $v ) {
        if( '' != $v ) {
                $where[] = "'%$v%'" ;
        }
}
$where = implode( ' OR ' , $where ) ;
$query = "select blah $where" ;

This is total crap but I've been up all night, so sorry. But 
at least you get the idea.

At 10:33 3.3. 2001, [EMAIL PROTECTED] wrote the following:
-------------------------------------------------------------- 
>The following query
>
>SELECT * from $database WHERE title LIKE '%$title%' OR quotation LIKE '%$quotation%'
>
>does not work as desired, if one of the two query fields in the HTML form stays 
>empty. How do I do this query properly, leaving the user the opportunity to narrow 
>the search by filling in as many fields as he wishes, e. g. "list all books with THIS 
>word in the title and/or THAT word in the quotation".
>
>---------------------------------------------------------------------
>Before posting, please check:
>   http://www.mysql.com/manual.php   (the manual)
>   http://lists.mysql.com/           (the list archive)
>
>To request this thread, e-mail <[EMAIL PROTECTED]>
>To unsubscribe, e-mail <[EMAIL PROTECTED]>
>Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
------end of quote------ 



____________________________________________________________
Cynic:

A member of a group of ancient Greek philosophers who taught
that virtue constitutes happiness and that self control is
the essential part of virtue.

[EMAIL PROTECTED]



---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to