Home  >  Article  >  Backend Development  >  Which PHP function is used to create a new database?

Which PHP function is used to create a new database?

WBOY
WBOYforward
2023-09-07 08:57:19731browse

Which PHP function is used to create a new database?

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

Syntax

bool mysql_query( sql, connection );

Example

Following are the parameters used in the function -

##SqlConnection
S. Number

Parameters and description

Required- Create SQL query for MySQL database

Optional - If not specified, the last opened connection by mysql_connect will be used.

The above is the detailed content of Which PHP function is used to create a new database?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:tutorialspoint.com. If there is any infringement, please contact admin@php.cn delete