August 9th, 1999, 10:07 AM
I'm starting with PHP, and I have any questions:
How interchange the values of global variables between different files of php's scripts?
in file bdgeo.php3
$bd contains the link to an open data base
this file call to other file named b1.php3
in file b1.php3
$db is unknow!
I think that the connection to the database should make only one time, in first script. In other way, How I maintain active the database connection among the different pages?
Can somebody help me?
Luis A. Gonzalez
August 9th, 1999, 02:55 PM
Nope, you have to re-establish the database connection on the next page. In the background, PHP may be using a persistent connection, but that depends on configuration.
Easiest way to do this is make an include file that has the database connection command(s) and then 'require("<file>.inc"); at the top of each script that needs a database.
Then if anything ever changes (location of DB, name, etc), you only have to change the parameters once...