Jump to content

Archived

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

barkster

Include Files

Recommended Posts

I'm wanting to create some include files that display some recordset information but I found that when I drop and include file on a page that aready has another recordset on it I get errors. Anyone have any suggestions on how to do this. I thinking it is because it calls the connection file twice or something? Thanks

 

Share this post


Link to post
Share on other sites

The included file has a connection in it, right? Get rid of it. But then, that will cause some errors, because it can't connect to the database on that page; ignore those warning marks. I know it's hard to do, but you have to do it. Dreamweaver seems to have issues with include files-if you try to use their include browser, it will only cause problems. Includes files are things that need to be hard-coded because of the inherent glitchiness of it's PHP support.

Share this post


Link to post
Share on other sites

Right, so I really only need to have one connection per page regardless of how many includes I have. Should I put the include in the main page which has includes or what? Thanks

Share this post


Link to post
Share on other sites

Well the point is, when a file is included, it actually becomes part of that page's code. So to avoid calling the database many times, just have the connection string in the page calling the include file and not in any of the included files.

Share this post


Link to post
Share on other sites

×

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.