<?php
$host="localhost"; // Host name
$username="MyUsername"; // Mysql username
$password="MyPassword"; // Mysql password
//The connection
mysql_connect("$host", "$username", "$password")or die("cannot connect");
//The Mysql commandline
$sql = "CREATE DATABASE MyFirstDB";
//Send the question to the database
$result = mysql_query($sql);
//If everything went as planned...
if($result)
{
echo "Database created!";
}
else
{
echo "Database was not created... =(";
}
?>
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