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

Is there a more efficient way to code this than what I have?
I have three associative arrays.

$combinedSettings
$userSettings
$defaultSettings

Typing math
I've added support for typesetting math using LaTeX on the forums.

Example:
Code: [Select]

Preg_match unknown modifyer
Hello,

Im trying to write a little script for my forums i need to get the reply from my forum

Coefficient of a Restitution Hints
Hello. I was wondering if anyone can give me hints on how to write this program...

The coeffi

losing variables between php brackets
Hi

have got this code:
Code: $id=mysql_result($result,0,"itemid");
$title=mys

How many users online in the last 24-hours using time()?
I'm fairly new to PHP. I have a MySQL table called 'users' and a field called 'loggedin' which is in

LIMIT $start, 10... how to pass last value queried into next page with GET??
Ok I know how to display the first or last 10 results of a query...

$result = mysql_query(&q

PHP Surveys
I really would like some advice.

If you have a client come to you asking for a survey to be d

Using real time in php
I'm very average at PHP and im looking to introduce time to something on my site.
Its a sports si

Passing vars to the DB
I have 3 small testing tables:

ID TYPE
1 pepperoni
2 C. bacon
3 taco

ID TY

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