Welcome to all our readers on our website at www.tutorialpath.com. As you all know that here on our website we will provide you lots of information related to the latest and newly introduced technology which help you to get updated with the latest tech. Here you will get all the useful information which is required in this tech world. As you know technology is one of the trending part in this world. So, here again we came up with a latest and new tech information which is related to the process of creating pages PHP Create MySQL Database. With the help of this article you will get to know the complete process of how to create PHP Create MySQL Database in a step by step manner. So, simply have a look to this article and grab all the useful information which is going to be very helpful for you.
Create a MySQL Database Using MySQL
The CREATE DATABASE statement is used to create a MySQL database.
Create database is used to create a MySQL database.
We must add the CREATE DATABASE statement to the mysql_query() function to execute the command.
Ex i(Create database)
In the above example first we create the connection with the database then we write statement to create a database of name employee after that this statement is passed to mysql_query() along with the connection variable of the database.
Create a table
The CREATE TABLE statement is used to create a table
Create table is used to create a table. while creating a table we can define several constraints such as primary key, unique key,auto_increment etc.
We must add the CREATE TABLE statement to the mysql_query() function to execute the command.
Ex (Create Table)
In the above example first we create the connection with the database then we select a database of name employee
then we write the statement to create a table,and this statement is passed to mysql_query().
Create a MySQL Database Using MySQLi and Object Oriented
Create a MySQL Database Using MySQLi and Procedural
Note : Here $host(localhost) is servername, $user(root) is default database user name. $pass(“”) default database password