#include file questions

Results 1 to 3 of 3

Thread: #include file questions

  1. #1
    casa Guest

    Default #include file questions

    I'm about to use my first #include file. I just haven't had much need to reuse the same code on several pages, but here's my question. Is it ok to created an object in the #include file, use it, and then destroy it if I'm going to use it again in the actual page? It seems like a waste of server cpu cycles to me. How should I create the database connection, use it in the #include then keep it open for the actual page? My only delima is that I will not have the database connection on every page that I will be including this file on, otherwise I would just open it in the #include and just close it at the end of the page.

  2. #2
    Join Date
    Dec 1969

    Default RE: #include file questions

    so just set the connection attributes in the include file,<BR>and if you need to open it on a certain page then open it.<BR><BR>don&#039;t open it in the include file, since you won&#039;t be using it on every page.

  3. #3
    Join Date
    Dec 1969

    Default RE: #include file questions

    I would open it in the include file and destroy it at the end of the include file.<BR>If you need to use it on the actual page, open the connection again. It is best to keep the connection open for as little time possible, even if it means closing and opening more than once on the same page.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts