PHP and MySQL Connection.

Wednesday, February 2, 2011

Unix database connection string for ipower, ipage, startlogic, bizland, fatcow, Readyhosting, blue host....
< ?php
$username = “your_name”;
$password = “your_password”;
$hostname = “localhost”;

//connection to the database
$dbname = mysql_connect($hostname, $username, $password)
or die(“Unable to connect to MySQL”);
echo “Connected to MySQL
“;
?>
Note: Here if  ($hostname, $username, $password) are matched then only it connect to $dbname (Database name). In most of the web page, you can view this code in config.php file.

No comments:

Post a Comment

 

Most Reading

Sidebar One

+1-800-574-0902 +44-20-7993-2673 (ID: 173296)