Re: Fwd: MySQLi connections

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Reading the thread on mysqli connection issues, I am curious if anyone knows of a downside to creating a connection from a configuration page and using it as a global in all functions?

I am used to creating a class and a database handle for functions to use, but I inherited an intranet that just uses a single "$mysqli = mysqli_connect ...." in a global main file and the just uses "global $mysqli" in all of it's functions (several hundred) that interact with the database.

Since I have not seen this structure used elsewhere, I assume there is a good reason not to use it, but I haven't found one (except for the security issue in the use of globals).

Could anyone point me towards any documentation on why such a structure is bad?

Thanks,

Jeff



--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux