Brinkster Knowledge Base

KB Home   /  Support  /  Database  /  MySQL  /   How do I connect to a MySQL database with PHP
How do I connect to a MySQL database with PHP Articles
Important information regarding the following code samples.

All references to "UserName" need to be replaced with your actual Brinkster UserName.
All references to "Password" need to be replaced with your actual Brinkster Password.


MySQL Database

Important information regarding the MySQL Database code sample.

The following server name reference is not specific: orf-mysql?.brinkster.com
Please log into your account, select the web site settings, and use the MySQL database name listed there.
username is case sensitive and must be all lower case.

<?

$dbhost = "mysqlX.brinkster.com";

$dbname_and_username = "Brinkster_UserName";

$dbpwd = "Brinkster_Password";

 

$conn = new COM('ADODB.Connection');

$conn->Open("DRIVER={MySQL ODBC 3.51 Driver}; SERVER=" . $dbhost . ";DATABASE=" . $dbname_and_username . ";UID=" . $dbname_and_username . ";PWD=" . $dbpwd . ";");

 

echo "<center><br><br>The MySQL connection has been opened.<br><br>";

$conn->close;

echo "The MySQL connection has been closed.</center>";

?>