RE: [PHP-WIN] Uninitialized Variables
| From: | Darvin Andrioli | Date: | Thu, 15 Mar 2001 09:11:11 +0000 |
| Subject: | RE: [PHP-WIN] Uninitialized Variables | ||
| Groups: | php.windows | ||
| Request: | Send a blank email to php-windows+get-6048@lists.php.net to get a copy of this message | ||
You may use the function isset.
Try this code:
if (!isset($id)) { // variable not set
}
Regards
Darvin
-----Original Message-----
From: Dwight Sparling [SMTP:dwight@ctinet.net]
Sent: Thursday, March 15, 2001 3:44 AM
To: php-windows@lists.php.net
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: php-windows-unsubscribe@lists.php.net
For additional commands, e-mail: php-windows-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net