Includes and Flushing

Not for 'how-to' coding questions but PHP theory instead, this forum is here for those of us who wish to learn about design aspects of programming with PHP.

Moderator: General Moderators

Post Reply
User avatar
SpecialK
Forum Commoner
Posts: 96
Joined: Mon Sep 18, 2006 3:49 pm

Includes and Flushing

Post by SpecialK »

I have the desire to include a progress image (the request is going to be huge - dozens of queries with a table that could be over 100 rows) because of a page that can take 30-60 seconds to return.

My question is about the include and flushing output.

This is on a page, that will be included with a querystring identifier. So the template is all present then it comes to this page.

Is the page processed with the PHP then included, or included then processed as one huge PHP page?



For example

index.php
include <header>
include <content>
include <footer>


content page
include <content stuff>
include <query output>


I want to be able to flush the content stuff, and the answer to the question depends on how I will have to design the page.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

The include is processed before continuing to process the calling script.
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Re: Includes and Flushing

Post by onion2k »

SpecialK wrote:(the request is going to be huge - dozens of queries with a table that could be over 100 rows)
100 rows is nothing. 100,000 rows isn't much. 100 million rows and I'd expect it to slow down a little.
User avatar
SpecialK
Forum Commoner
Posts: 96
Joined: Mon Sep 18, 2006 3:49 pm

Post by SpecialK »

@onion2k

The real issue isn't the 100 rows in the html table. The issue is the database.

It's on an IBM server with a non-indexed table (or file as its referred to there) on a DB2 platform which has over 1 mil entries. (Not my choice). It doesn't help that one of the data I need to search for I can't join as part of the query because it requires a 'order by X desc fetch first 1 rows only' to restrict the last entry (I posted this here in the DB section I believe).

I am not able to call to the table directly, but call to another file which makes the actual call to the DB and returns delimited data to PHP which is then processed.

I consider this horribly slow but my hands are tied when it comes to the options here (I was told PHP to DB2 was tried and was too slow anyway). I am just supposed to do the PHP end and can't have any say in the database.

As you point out, if the DB is designed properly, then the actual amount of returned data is trivially small.
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Post by superdezign »

SpecialK wrote:@onion2k

The real issue isn't the 100 rows in the html table. The issue is the database.
Considering that's directed at onion2k, I'm pretty sure he knew what you were referring to. :wink:
You did say queries.
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

Answer: included then processed as one huge PHP page.

Essentially you are bringing in all the included files into the page you are on.
Post Reply