Initializing a db $var and retrieving a required CONSTANT
| From: | (Dreamriver.com) | Date: | Sun, 05 May 2002 09:32:59 +0000 |
| Subject: | Initializing a db $var and retrieving a required CONSTANT | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-96139@lists.php.net to get a copy of this message | ||
Hi Folks,
Two questions:
1) Initializing a db $var
What's the best way to code $dbvar, which is coming from a database query, given the new
superglobals:
$data = mysql_fetch_array();
$dbvar = stripslashes($data['someFieldName']);
Is there a newer or better way to initialize $dbvar?
2) retrieving a required CONSTANT
If a CONSTANT is defined on foo.php and called with a require_once("foo.php") on another
page called bar.php, then CONSTANT is not global and is not called with the new supernotation, but
rather same as before:
$someVar = CONSTANT;
... correct?
richard.