RE: [PHP-DB] Query with optional params

2003-01-05 Thread Rich Hutchins
Cc: [EMAIL PROTECTED] Subject: Re: [PHP-DB] Query with optional params Rich, When I do searches with multiple fields, I construct the SQL string on the PHP side. You can do something like this: $sql = "SELECT * FROM docmeta WHERE "; if( $PartNumber ) $sql .= "Par

Re: [PHP-DB] Query with optional params

2003-01-05 Thread David Smith
Rich, When I do searches with multiple fields, I construct the SQL string on the PHP side. You can do something like this: $sql = "SELECT * FROM docmeta WHERE "; if( $PartNumber ) $sql .= "PartNumber='$PartNumber'"; if( $Title ) $sql .= " AND Title='$Title'"; and so on... That

[PHP-DB] Query with optional params

2003-01-05 Thread Rich Hutchins
I have a search page on which I place six fields into which users may enter data to perform a search. For ease of explanation, the fields are: Part Number Title Subtitle Print Date Status Type All of these fields reside in the same table, named docmeta, in a MySQL database. I'm running into a log