Jump to content

include files in php class


coder330

Recommended Posts

he guys, everyone one on this forum has been really helpful, thanks for all the help!

 

1 more question:

so I have a file called "config.inc.php" that has an array with all the database connection information.

when "include_once" this file in a simple php file such as test.php, it works fine as i simply get array values.

ex: $config['database'], $config['username'] etc.

but when i "include_once" it in a php class such as test.class.php, it doesnt work. can you tell me what am i doing wrong? how do i include it in a class.

Link to comment
https://forums.phpfreaks.com/topic/149491-include-files-in-php-class/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.