MySQL connect (PHP)
by spyka (http://www.spyka.net)
This code shows you how to connect to a MySQL database and displays an error message if connection fails. Change user/password/db to your info.
The mysql_host will usually be localhost but check with your hosting provider.
<?
// Connect
$con = mysql_connect("mysql_host","mysql_username","mysql_pass") or die(mysql_error());
$db = mysql_select_db("db_name") or die(mysql_error());
// all connected - do SQL stuff
// close connection
mysql_close($con);
?>
Code demo
Not available