RE: [PHP] Initializing a db $var and retrieving a required CONSTANT

From: Date: Sun, 05 May 2002 17:52:43 +0000
Subject: RE: [PHP] Initializing a db $var and retrieving a required CONSTANT
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-96148@lists.php.net to get a copy of this message
Neither of those change. You don't have to use stripslashes() on incoming DB data, unless magic_quotes_runtime is ON in php.ini. ---John Holmes... > -----Original Message----- > From: Dreamriver.com [mailto:info@dreamriver.com] > Sent: Sunday, May 05, 2002 2:33 AM > To: php-general@lists.php.net > Cc: archive@dreamriver.com > Subject: [PHP] Initializing a db $var and retrieving a required CONSTANT > > > 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. > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.general (#96148) next »