User feedback after MySQL query has been executed


Posted on 16th Feb 2014 07:03 pm by admin

Hi all, I've just registered on PHPFreaks because I've got a question that I simply can't work out by myself.

Im developing a web based reporting application, based upon PHP/MySQL. At some point the user can chose some parameters from a form like dates etc and hit a button, then the form data is submitted to execute_report.php, which contains some code as follos:

Code: <html>
Some html stuff here, like text output for the user, that the query xyz has been started

<?php
Here goes the first query
?>

Then html code again to insert a line that the query has finished

Another line of text that the next query has started

<?php
And the next MySQL query
?>

Text again that the query has finished ... and so on
</html>

Basically everything works like a charm. The queries do what I want and deliver the output and results just fine. What bugs me is, that all results and the html text output are only displayed after the last query has finished.

During the whole executing time, the browser just says "Loading" until the queries have executed, then all results are displayed the way I intended them to.

I already tried experimenting with putting the queries into functions and also with sleep commands, but to no avail.

I would love to give the user a feedback before a query starts and after it has finished, sort of in "Real time". Any tips would be greatly appreciated

No comments posted yet

Your Answer:

Login to answer
216 Like 50 Dislike
Previous forums Next forums
Other forums

Collecting AOL Search Terms
I am attempting to collect AOL search terms. I know the code is correct (it works for google, bing,

Displaying image from database
Hi,

I've got a site where that's got a database behind it. Currently it has loads of items in

Procedural to OOP
ohn Kleijn said that to avoid writing "crappy code", we should learn OOP and common OO pri

how do I show what a user have selected from a checkbox?
From my code below, how would i show which check boxes have been checked and which radio buttons sel

'210010106140040100' == '210010106140040101'
Debugging this simple line of a PHP script

Code: if($a == $b){ }
I've found that with val

get url?
how do i get the url of the page i'm currently on, on my website.. i think its get header.. how do i

Check premium expire
Hi,

I am making a simple file hosting site and want to check if users premium subscriptions h

how to use two buttons with php
hi i have one form. there are three fields which are to be filled by the user. and then there are tw

Forgot password won't work
My forgot password thing is not working properly. It is giving me this errorMailbox unavailable. The

need to add "sizes" to shopping cart
Hey guys, I am trying to figure out a way to add a "size" selector on to this bit of code.

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash