MySQL Code
Code
<?php mysql_connect("localhost","username","password") or die("Cannot connect to MySQL Database");?>
or die() function gives you an erro.
Code
<?php @mysql_connect("localhost","username","password") or die("Cannot connect to MySQL Database");?>
The @ symbol is used to supress the error
Code
<?php
$host = "localhost";
$dbname = "";
$pass = "";
@mysql_connect( $dbname,$pass,$host ) or die ("ySQL Cannot Connect to the Database.);
?>
Tutorial on Creating Database
1) In your MySQL Databases part of the cpanel, you will see a box called New Database:[type your datbase name!!], then click create database.
2) Click go back and go down a bit more, you will see two more new boxes, Username and Password, type the username and the password, then click Create.
3) Click go back and go down to the Drop Down Menus. Click the arrow and put the name to the datbase. Then click on Add User to Datbase. You are now ready to use the codes above.