I'm new to PHP, due to having been all hard-nosed and obtuse about
I've been looking for a good way to pick up php tricks and what-nots,
so I joined the list.
That said, I have an immediate question.
I have a multi-file script:
main.php requires_once config.php, and so on. I'd like to have a
data.php file that handles function wrappers for database and also
establishes a connection to the db.
I read in the php.net manual that the connection closes automatically
when the script exits. Does this mean I can't open a db connection in
one file and pass the link around from function to function?
require_once 'data.php'; // data.php contains a mysql_connect()
// after this line, is my link closed?
require_once 'blah.php' ;
require_once 'data.php'; // with wrapper data_connection()
$save_this_link = data_connection() ; // will this work?
some_function( $save_this_link ) ; //etc.
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php