function ConnectDB()
{
$host="localhost"; // Host name
$username="MyUsername"; // Mysql username
$password="MyPassword"; // Mysql password
$db_name="MyDB"; // Database name
$tbl_name="MyTable"; // Table name
mysql_connect("$host", "$username", "$password")or die("cannot connect");
mysql_select_db("$db_name")or die("cannot select DB");
}
$link = mysql_connect("localhost", "MyUsername", "MyPassword");
if(mysql_query("DO SOMETHING", $link))
{
echo "Something has been done!";
}
else
{
echo "Something was not done =(";
}
mysql_close();
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