Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old August 24th, 2005, 08:05 AM
sindre hiåsen
Guest
 
Posts: n/a
Default How to delay the start of a function

Hi,

My problem is that a function in the page have a rather heavy mysql query.
The query takes between 6 - 10 seconds. while the query takes place other
content on the page stop loading (Opera). Explorer and Firefox seems to
wait for the whole page to load befor drawing the site.

Is there a way to tell the browser to draw all the content except for this
function and run through this at the end, alternatively to run the process
in backround?

This functionality a want is on many sites who let you search through
multiple whois databases.


Regards,

Sindre
  #2  
Old August 24th, 2005, 08:15 AM
Ramon
Guest
 
Posts: n/a
Default Re: How to delay the start of a function

Well... I can't say that I know a PHP solution to this problem.
But if I were in your shoes I would split up the content I need rendered
and the function in question. Make sure that the *function* is sitting
in its own PHP file. Then render all the other content in the main
window. And have a frame or and iframe render the other function in its
own PHP file.

hope that makes sence. As I'm tired.

Cheers,

D


sindre hiåsen wrote:[color=blue]
> Hi,
>
> My problem is that a function in the page have a rather heavy mysql
> query. The query takes between 6 - 10 seconds. while the query takes
> place other content on the page stop loading (Opera). Explorer and
> Firefox seems to wait for the whole page to load befor drawing the site.
>
> Is there a way to tell the browser to draw all the content except for
> this function and run through this at the end, alternatively to run the
> process in backround?
>
> This functionality a want is on many sites who let you search through
> multiple whois databases.
>
>
> Regards,
>
> Sindre[/color]
  #3  
Old August 24th, 2005, 09:35 AM
Colin McKinnon
Guest
 
Posts: n/a
Default Re: How to delay the start of a function

sindre hiåsen wrote:
[color=blue]
> Hi,
>
> My problem is that a function in the page have a rather heavy mysql query.
> The query takes between 6 - 10 seconds. while the query takes place other
> content on the page stop loading (Opera). Explorer and Firefox seems to
> wait for the whole page to load befor drawing the site.
>
> Is there a way to tell the browser to draw all the content except for this
> function and run through this at the end, alternatively to run the process
> in backround?
>
> This functionality a want is on many sites who let you search through
> multiple whois databases.
>[/color]

Use flush() before the function.

If you're really clever with CSS or javascript, you could generate the rest
of the page apart from the query output, call the function at the end of
the script and make it appear in the middle of the page but this is not
trivial.

Alternatively fix your query/schema so it goes faster (go ask on a MySQL
group, quoting the query and the output of EXPLAIN...)

C.
  #4  
Old August 25th, 2005, 08:15 AM
sindre hiåsen
Guest
 
Posts: n/a
Default Re: How to delay the start of a function

On Wed, 24 Aug 2005 10:29:14 +0200, Colin McKinnon
<colin.deletethis@andthis.mms3.com> wrote:
[color=blue]
> sindre hiåsen wrote:
>[color=green]
>> Hi,
>>
>> My problem is that a function in the page have a rather heavy mysql
>> query.
>> The query takes between 6 - 10 seconds. while the query takes place
>> other
>> content on the page stop loading (Opera). Explorer and Firefox seems to
>> wait for the whole page to load befor drawing the site.
>>
>> Is there a way to tell the browser to draw all the content except for
>> this
>> function and run through this at the end, alternatively to run the
>> process
>> in backround?
>>
>> This functionality a want is on many sites who let you search through
>> multiple whois databases.
>>[/color]
>
> Use flush() before the function.
>
> If you're really clever with CSS or javascript, you could generate the
> rest
> of the page apart from the query output, call the function at the end of
> the script and make it appear in the middle of the page but this is not
> trivial.
>
> Alternatively fix your query/schema so it goes faster (go ask on a MySQL
> group, quoting the query and the output of EXPLAIN...)
>
> C.[/color]

Thanks to both. The IFrame should do it I think. Cant say why i havent
thought of that!

Sindre


--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles