Definition of global variable

xiaoxiao2021-03-06  112

1, define global variables:

We put the file in a separate script, which is relatively convenient.

Config.php

$ db_server = "localhost"; // server name

$ db_name = "mysql"; // Database name

$ db_username = "root"; // user name

$ db_userpassword = ""; // User password

$ TABLE = "Table"; // Name of the table in the database

?> During connection with the database, you need to define some global variables, saved as separate files, when calling, use Require ("") or include (");

The benefits of doing this are to be more convenient to call and change later.

转载请注明原文地址:https://www.9cbs.com/read-101291.html

New Post(0)