Jump to content

Require_Once


burtybob

Recommended Posts

Your question is a little confusing. But from what I gather of it. using require/require_once in either file all files or other.  Depends on how your files are structured.

 

The require aspect only pertains to the file, and the script thats in it. So if you require the file and place the line up top of your script to bring it in. It should connect to your DB as many times as the script needs, unless you close the connection to the DB after you run a query. That being the case, strip out any mysql_close() that you have below the require statement and put one at the bottom of the page you are pulling the script into.

 

Also you can not require_once() the same file more than once in the same script it will just conflict and cause error.

 

So if you pull 3 files together through one master files and all 3 need that required file to connect then put the connection file up top above all the others and make sure your not pulling in the required file again through the other scripts..

 

Yes I know this is a jumble. I appologize, but its the best way I can come up with describing it based on your initial question.. not knowing how your doing everything, no exact examples, just a simple generalized question that is a bit confusing to begin with makes answers harder to come up with.

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.