To access a MySQL database in PHP you can use the following script:
<?php
$dbhost = 'mysql.myserver.net';
$dbuser = 'myname';
$dbpass = 'mypassword';
$conn = mysql_connect($dbhost, $dbuser, $dbpass) or die
('Error connecting to mysql');
$dbname = 'mydatabase';
mysql_select_db($dbname);
?>
Remember to change the Host address to the address of your MySQL database; also you will need to change the dbname, dbuser and dbpass parameters as appropriate.

Blog
Recent Posts
Live Help
Chat to a member of our sales support team live, now, to answer all of your questions.
Categories