MySQL Create Database

by Yogesh Khanna 09-Jun-16

0 1024


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";
}

?


Share:


Discount Coupons



Comments

    Waiting for your comments

Leave a Reply