PHP Connection to MySQL
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. If you are unsure of any of these settings contact WebMe support through your Control Panel.
See how to access a MySQL database using ASP.
|