Page 1 of 1

Includes and Flushing

Posted: Tue Jun 05, 2007 1:10 pm
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.

Posted: Tue Jun 05, 2007 1:32 pm
by feyd
The include is processed before continuing to process the calling script.

Re: Includes and Flushing

Posted: Tue Jun 05, 2007 2:08 pm
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.

Posted: Tue Jun 05, 2007 2:59 pm
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.

Posted: Tue Jun 05, 2007 3:28 pm
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.

Posted: Tue Jun 05, 2007 3:52 pm
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.