Re: Query with multiple form fields

2001-03-03 Thread Jason Landry
ery = "select * from $database where title like '%$title "; if(!empty($quotation)) $query .= " $operator quotation like '%$quotation%'"; - Original Message - From: <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Saturday, March 03, 2001 3:33

Re: Query with multiple form fields

2001-03-03 Thread Cynic
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

Query with multiple form fields

2001-03-03 Thread georg
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 a