ConnectDB()
Written by: maffelu , 2009-04-16 18:11:19
<?php
ConnectDB();
?>
function ConnectDB()
{
$host="MyHost"; // Host name, could be localhost, an IP or a URL
$username="MyUsername"; // Mysql username
$password="MyPassword"; // Mysql password
$db_name="MyDB"; // Database name
mysql_connect("$host", "$username", "$password")or die("cannot connect");
mysql_select_db("$db_name")or die("cannot select DB");
}
There are no comments on this article.
If you have any question or just want to leave a message, just fill out the form below!
Your e-mail will not be visible in your post, it is for validation reasons only
Maffelu
Creator and admin of MorkaLork.com.
Started programming in HTML back when frames and tables was the way to design a page, moved on to Pascal/Delphi, PHP, javascript/jQuery, VB.NET/C#, Java and C++.
Currently studies .NET (in general) focusing on ASP.NET.