Re: Curious if include_once will work better than include
| From: | Daniel Clark | Date: | Tue, 13 Apr 2004 16:06:01 +0000 |
| Subject: | Re: Curious if include_once will work better than include | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-33859@lists.php.net to get a copy of this message | ||
My understanding is include_once() called several times in the same page
or include files will only be included once.
> Curious about "include_once" versus "include".
>
> All my connection stuff is in "conn.php3".
>
> I am planning on including it at the top of the page like this:
> include_once "conn.php3";
>
> Now will that speed things up compared to just using a plain "include". I
> call $connectionSDWIS(which is in the include) 5 different times?
>
> $data = odbc_do($connectionSDWIS,"EXEC sp_SanitarySurveyLatest '$pwsno'");
> $data = odbc_do($connectionSDWIS, "Select Distinct CASE ActivityStatus
> WHEN 'A' THEN 'ACTIVE' WHEN 'I' THEN 'INACTIVE' END +
> ' ' + CASE
> Convert(varchar,ActDate,107) WHEN 'May 05, 1955' THEN '' ELSE
> Convert(varchar,ActDate,107) END As 'ActivityStatus' FROM Inventory Where
> PWSID='$pwsno'");
> $data2 = odbc_do($connectionSDWIS,"Exec sp_EntryPointsWithSourcesAndPWS
> '$pwsno'");
> $data=odbc_do($connectionSDWIS,"SELECT StateID, WSFName, TreatmentProcess,
> TreatmentObjective FROM Treatments WHERE PWS= '$pwsno' ORDER BY StateID");
> $data = odbc_do($connectionSDWIS, "SELECT CalendarYear,
> convert(varchar(12),ReceivedDate, 107), convert(varchar(12),CertifiedDate,
> 107) FROM CCRS WHERE PWS='$pwsno' ORDER BY CalendarYear Desc");