Home  >  Article  >  Backend Development  >  Which PHP function is used to select MySQL database?

Which PHP function is used to select MySQL database?

PHPz
PHPzforward
2023-09-10 14:45:021359browse

Which PHP function is used to select MySQL database?

PHP uses the mysql_select_db function to select 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_select_db( db_name, connection );

The parameters used by this function are as follows:

##1db_name##2
Sr .No

##Parameters and description

Required - The name of the MySQL database to be selected p>

Connection

Optional - If not specified, the last opened connection will use mysql_connect.

The above is the detailed content of Which PHP function is used to select MySQL 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