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
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
]; [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
$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(
4 matches
Mail list logo