Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.

dbconnect

Opens or re-uses a connection to a MySQL server.

dbconnect

Quote

dbconnect ( string $db_host, string $db_user, string $db_pass, string $db_name )


Parameters
db_host
The MySQL server. It can also include a port number. e.g. "hostname:port" or a path to a local socket e.g. ":/path/to/socket" for the localhost.
If the PHP directive mysql.default_host is undefined (default), then the default value is 'localhost:3306'. In SQL safe mode, this parameter is ignored and value 'localhost:3306' is always used.

db_user
The username. Default value is defined by mysql.default_user. In SQL safe mode, this parameter is ignored and the name of the user that owns the server process is used.
password
The password. Default value is defined by mysql.default_password. In SQL safe mode, this parameter is ignored and empty password is used.

db_name
The name of the database that is to be selected.

Return Values
Returns a MySQL link identifier on success, or "Unable to establish connection to MySQL" on failure.

Example
Code
<?php
// Establish a MySQL database connection
$link = dbconnect($db_host, $db_user, $db_pass, $db_name);
?>


Changelog
7.01.00 - XHTML valid

Notes
All varibles for the dbconnect() function is stored in the config.php file.