<?php
if(! mysql_connect('servername','username','password'))
{
die('Connection failed!'.mysql_error());
}
$sql = "create database newdb"; if(mysql_query($sql))
{
echo "Database created";
}
else
{
echo mysql_error();
}
?>
------------------------------------------------------------- Note: When we are using XAMPP or WAMP, servername = localhost, username = root, password is empty.
Comments
Post a Comment