I’ve three files:
index.php
/include/conf.php
/include/database.php
conf.php contains variables to connect to the database.
database.php includes conf.php and has a function to return an entire table as array. index.php includes /include/database.php and calls get_table('users');
XDebug says me that $db_host, $db_user, $db_pass and $db_name are not defined.
How can I pass the Database related variables through external files?
Use PHP Define function
eg:
Or Use
PHP Session variable