Database functions and classes.
$Id: database.php 594 2006-03-20 11:12:42Z stijn $
Database connection failed status code.
Status code returned by db_mysql::connect and db_postgresl::connect when the database connection could not be made; an invalid combination of databasename/user/password was given or the database user lacks permissions.
Database type not supported status code.
Status code returned by db_mysql::connect and db_postgresl::connect when the configured database was of a type that was not supported by the current installation of PHP.
Database connection ok status code.
Status code returned by db_mysql::connect and db_postgresl::connect when the database connection was succesfully created.
Use only associative arrays for query result sets.
Method indicator for db_mysql::fetch_array and db_postgresql::fetch_array. The resulting array will be returned as a purely associative array.
Use both associative and numerical indices for query result sets.
Method indicator for db_mysql::fetch_array and db_postgresql::fetch_array. The resulting array will be returned as an array wich both numerically and associatively indexes the rows of the result set.
Next row value.
Indicates that the caller wants to fetch the next row to db_mysql::fetch_array or db_postgresql::fetch_array.
Use a numerically indexed array for query result sets.
Method indicator for db_mysql::fetch_array and db_postgresql::fetch_array. The resulting array will be returned as a purely numerically indexed array.
Return a connected database object.
This is the master function to connect to a database. Based on a database name, it returns either an error code or a connected database object.
The database name is actually the name of an SWS database configuration file, in which the actual parameters for connecting to the database are defined. See db_get_parameters for details about the configuration file location. See $swsroot/etc/db.example for an example of the syntax.
This function caches the connection per request. The first call will initiate the connection to the database and the connection will persist until the request has been completed or the db_mysql::close method is called to close the connection explicitly. Note that in the last case, it is not possible to reconnect to the same database on the same request!
Retrieve configured database parameters for a database.
This function returns an associative array of parameters for a specific database, as configured by the system.
Configuration files are searched for in SWSCONFIGDIR/db, and then in $swsrootdir/etc/db, in that order.
The following keys are present in the resulting array:
Returns a privileged connection to the SWS database. Obviously only works if the caller is allowed access (this might not be the case in a secure virtual host setup).
Documentation generated on Fri, 30 Jun 2006 10:31:37 +0200 by phpDocumentor 1.3.0RC3