Home > Article > Backend Development > 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 -
bool mysql_select_db( db_name, connection );
The parameters used by this function are as follows:
Sr .No | ##Parameters and description |
db_name | Required - The name of the MySQL database to be selected p> | ##2
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!