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
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
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