MySQL Create Database
0 3970
A database is the container of tables. For creating a MYSQL Database firstly, we need to make connection with the server.
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"; } ?
To check your database, go to localhost panel:
http://localhost/phpmyadmin
Share:
Comments
Waiting for your comments