Description
db_connect connects to a database using the configuration settings found in monju/modules/configuration.inc.php. It uses PHP Data Objects to create an abstraction later to be able to connect to many different types of databases. It also adds security through parameterization as well as performance. Creating a new connection will create a global variable $Monju_Hash. Do not overwrite it manually.
Parameters
None.
Return Values
On Success: True On Failure: False
Notes
This first checks if a connection is already made, and only creates a new one if needed.
Examples
// create a new connection to the database db_connect(); // ... use db_query() to query the database
Dependencies
- Must have properly configured the database settings in monju/modules/configuration.inc.php
If you notice a mistake in the documentation, instead file a bug report in the issue tracker. Instead use this to add tips and tricks associated with the functions. You can use tags like to keep your comments clear.