Jump to content

Include not working


siric

Recommended Posts

Hello,

 

I have the following code (which opens a database connection and then links to a table.)

include("config.inc.php");

at the beginning of a script, but the file (which exists in the same directory as the script) is not being called.  

 

I have verified that the file is there and that the spelling is correct (there is no complaint for PHP not being able to read the file)

 

Since it is not being read, the mysql search is not working.

 

If I copy the lines from the config.inc.php file to this file, everything works.

 

I have tried using the full directory structure to no avail.

 

Any ideas?

 

Thanks

 

Steve

Link to comment
https://forums.phpfreaks.com/topic/296656-include-not-working/
Share on other sites

your code should ALWAYS test if database statements worked or not and when they fail, display a user message (sorry this page isn't working now) and display (during development) or log (on a live server) the actual error information, and then prevent the remainder of the database dependent code from running so as to not throw follow-on errors.

 

code that contains error checking and error reporting logic for statements that can fail, will tell you when, where, and why it has failed.

Link to comment
https://forums.phpfreaks.com/topic/296656-include-not-working/#findComment-1513252
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.