MySql Create Database

MySql Create DB

The statement used for database creation is ‘CREATE DATABASE’.

<?php

$servername="localhost";
$username="user";
$password="pass";

//Create connection
$connect=mysql_connect($servername,$username,$password); or die("Connection failed");

//After connecting to mysql, create Database
$db="CREATE DATABASE user";

if(mysql_query($connect,$db))
{
echo "Database Successfully Created";
}
else
{
echo "Database Creation Failed";
}

?>



Coding Tag

Coding Tag always happy to serve you in Information Technology (IT). Learn HTML, CSS, Javascript, PHP, Android, Digital Marketing, Latest IT News and many more.

Leave a Reply

avatar
  Subscribe  
Notify of