PHP program to create a new database in MySQL

By: Editorial Staff | Last Updated: | In: PHP Tutorials


In this tutorial, I will explain how to create MySQL database using PHP programming language. Below examples will help you in the better understanding of MySQL database connection and database creation using the PHP programming language.

PHP program to create a new database in MySQL

In the below example for first, we have created a database connection and then checked the database connection and then create a database as “myNewDB” using MySQL create statement.