You may use the function isset.

Try this code:

if (!isset($id)) {  // variable not set
                   }

Regards

Darvin 

-----Original Message-----
From:   Dwight Sparling [SMTP:[EMAIL PROTECTED]]
Sent:   Thursday, March 15, 2001 3:44 AM
To:     [EMAIL PROTECTED]
Subject:        [PHP-WIN] Uninitialized Variables

Can PHP deal with variables that are not initialized? It is kicking out an
error when it runs into something that is not defined yet.

mysql_select_db("mydb",$db);

if ($id) {                              <=========Not initialized and PHP
kicks an error?

  // query the DB


Thanks!
Dwight



-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to