Re: Function problem???

From: Date: Sat, 11 Aug 2001 16:11:27 +0000
Subject: Re: Function problem???
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-11243@lists.php.net to get a copy of this message
If you have more functions in library file you intend to include.. there's error in syntax.. that is you're having functions within a the Includ_Lib function. If you have variables in the library file, they're local within the Include_Lib function, and hence will not be available out of it, and in fact, will be destroyed as soon as the function is done. In other words, the concept wont work. Just do an include at which ever point you need it, but do it only once per script. Dreamvale ----- Original Message ----- From: "Brian Grayless" <bgrayless@Premier-Resorts.com> To: "PHP DB list (E-mail)" <php-db@lists.php.net> Sent: Saturday, August 11, 2001 12:04 AM Subject: [PHP-DB] Function problem??? > Anybody know what might be wrong with this function? > > My first version of the function was... > > function Include_Lib($libFile) > { > include(LIB_DIR.$libFile); > } > > but it didn't work so I simplied it... > > function Include_Lib() > { > include("/path/generic_vars.phpi"); > } > // Function call > Include_Lib(); > > > and it still doesn't work????? HELP!! I can't figure out what I'm missing??? > I have this included in a file that is also included. Would that cause a > problem??? > > B R I A N G R A Y L E S S > Web Administrator > Premier Resorts > www.premier-resorts.com > > P: 435-655-4812 > F: 413-618-1518 > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net > For additional commands, e-mail: php-db-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.db (#11243) next »