Jump to content

Include not working


siric
Go to solution Solved by 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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.