Home  >  Article  >  Backend Development  >  What is the name of the php database configuration file?

What is the name of the php database configuration file?

(*-*)浩
(*-*)浩Original
2019-09-26 14:25:153645browse

What is the name of the php database configuration file?

Create database configuration file in php code. (Recommended learning: PHP programming from entry to proficiency)

Write the database user name, password and other information to the configuration file config.php, and reference the configuration file when needed Use include or require in the content file, and use the global keyword in the function to globalize the variables that store the database name, password, etc., so that they can be used in the function in the file.

1, config.php database configuration file:

Database operation class (calling configuration file) db.fun.php:

";
echo "数据库密码:".$db_password."
"; } } ?>

Application file test.php:

fun();
?>

The above is the detailed content of What is the name of the php database configuration file?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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