Problem with searching in database
| From: | Daniel Rezny | Date: | Wed, 13 Sep 2000 07:08:11 +0000 |
| Subject: | Problem with searching in database | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-2853@lists.php.net to get a copy of this message | ||
Hello all,
I met with a little problem with mysql+php4 on win2000. I have search
criteria for database like this:
if($birthy != "")
{
$query= "select id,birthdatum,todesdatum,nachname,vorname from doew where birthdatum
like '%$birthy%'";
}
elseif($diey != "")
{
$query= "select id,birthdatum,todesdatum,nachname,vorname from doew where todesjahr
like '%$diey%'";
}
elseif($nachname1 != "")
{
$query= "select id,birthdatum,todesdatum,nachname,vorname from doew where nachname like
'%$nachname1%'";
}
elseif ($name1 != "")
{
$query= "select id,birthdatum,todesdatum,nachname,vorname from doew where vorname like
'%$name1%'";
}
else
{
$query= "select id,birthdatum,todesdatum,nachname,vorname from doew where 1=1";
}
Everithing working correct if I want to search only by one field. If I
want to search by more fields it search only by the first one. I use
this script on linux+php3+mysql and working correctly. Do somebody
know why it is.
Thank you for every help.
--
Best regards,
Daniel