[PHP] Another question - not exactly what i was looking for

2002-01-15 Thread Phil Schwarzmann
Yo, thanks for all your help. But it isn't exactly what im looking for. Let's say you had a database with the following four columns... -LastName -FirstName -Age -Weight ...and you wanted a page that would allow a user to search for one or more of these fields within the database. It would

Re: [PHP] Another question - not exactly what i was looking for

2002-01-15 Thread mike cullerton
how 'bout something like $query = 'select * from table_name where '; $and = ''; if ($lastname != '') { $query .= lastname = $lastname; $and = ' and '; } if ($firstname != '') { $query .= $comma.firstname = $firstname; $and = ' and '; } and so on on 1/15/02 1:53 PM, Phil Schwarzmann at

Re: [PHP] Another question - not exactly what i was looking for

2002-01-15 Thread R'twick Niceorgaw
]; [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Tuesday, January 15, 2002 3:53 PM Subject: [PHP] Another question - not exactly what i was looking for Yo, thanks for all your help. But it isn't exactly what im looking for. Let's say you had a database with the following four columns... -LastName

Re: [PHP] Another question - not exactly what i was looking for

2002-01-15 Thread Christopher William Wesley
$where_conditions = array(); if( !empty( $lastname ) ){ $where_conditions[] = lastname like '%${lastname}%'; } if( !empty( $firstname ) ){ $where_conditions[] = firstname like '%${firstname}%'; } if( !empty( $age ) ){ $where_conditions[] = age = ${age}; } if( !empty(