Maybe try somthing like this, write a function containing all your like statements.
function likeStatements( ){ //write your statements in this function if they are always the same. } //then have an if structure like the following that calls that function in a while loop. if ( isset($a) && !isset($b) ){ while ($a){ likeStatements(); //you could also pass any needed info to the function. } }elseif( isset($b) && !isset($a) ){ while ($b){ likeStatements(); } }elseif( isset($a) && isset($b) ){ while ($a && $b){ likeStatements(); } } HTH, Steve. -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Wednesday, September 04, 2002 10:26 AM To: [EMAIL PROTECTED] Subject: [PHP] question I have a php question. I would like to enter a "while" loop, but: I want it to be like this: when $a has a value, while $a... when $b has a value, while $b... (same statements as with $a) when $a has a value, and $b has a value, while $a and $b this is based on a search system in which the user can enter a, b or a and b. Can you help me with my problem, or help me find someone who can?! Thanks. Dore van Hoorn. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php