Any good way ?
| From: | TV Karthick Kumar | Date: | Fri, 19 Jan 2001 10:40:04 +0000 |
| Subject: | Any good way ? | ||
| Groups: | php.db php.general | ||
| Request: | Send a blank email to php-general+get-35609@lists.php.net to get a copy of this message | ||
Hi all
I have written the following code, but I dont' think it's a good way to
write like this. Is there some other way to do good programming for this ?!
****************************************************************************
******************
if ($f)
{
$SQL .= " (FIRST_NAME like '%$f%') AND ";
}
if ($l)
{
$SQL .= " (LAST_NAME like '%$l%') AND ";
}
if ($em)
{
$SQL .= " (HOME_EMAIL1 like '%$em%') OR (HOME_EMAIL2 like '%$em%') OR
(WORK_EMAIL1 like '%$em%') OR (WORK_EMAIL2 like '%$em%') ";
}
****************************************************************************
******************
Any help is appreciated very much.
Thanks in adv.
~ Karthick