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

Which PHP function is used to select MySQL database?

PHPz
Release: 2023-09-10 14:48:02
forward
1393 people have browsed it

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 );
Copy after login

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!

Related labels:
source:tutorialspoint.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template