Home > Backend Development > PHP Problem > php cannot select database

php cannot select database

angryTom
Release: 2023-02-27 20:58:01
Original
3853 people have browsed it

php cannot select database

php cannot select the database

We may report the following error when selecting the database. How to solve it? Get up and study.

Warning: mysqli_select_db() expects exactly 2 parameters, 1 given in D:\wamp\www\test\connect.php on line 8
Copy after login

When PHP connects to the database:

There is no problem connecting to the database with mysqli_connect, but there is always an error when using mysqli_select_db!

After careful observation of mysql_select_db and mysqli_select_db, I found that

●The incoming parameters of mysql_select_db are (databaseName, query);

●The incoming parameters of mysqli_select_db are (query, databaseName );

The order of the incoming parameters of the two connection methods is not the same, so the selection fails.

For more PHP related knowledge, please visit PHP Chinese website!

The above is the detailed content of php cannot select database. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
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