Which PHP function is used to create a new database?

MySQLMySQLi DatabasePHP

PHP uses mysql_query function to create a MySQL database. This function takes two parameters and returns TRUE on success or FALSE on failure. Its syntax is as follows −

Syntax

bool mysql_query( sql, connection );

Example

Followings are the parameters used in this function −

S. No.
Parameter & Description
Sql
Required - SQL query to create a MySQL database
connection
Optional - if not specified, then the last opened connection by mysql_connect will be used.
raja
Published on 22-Feb-2018 14:43:24
Advertisements