The CREATE DATABASE statement is used to create a database in MySQL.
Syntax
CREATE DATABASE database_name |
To learn more about SQL, please visit our SQL tutorial.
To get PHP to execute the statement above we must use the mysql_query() function. This function is used to send a query or command to a MySQL connection.
Example
The following example creates a database called "my_db":
< ?php |