The root problem may very well be inefficient SQL query usage, which if
fixed, would negate the need for a progress message altogether. You may
want to spend some time optimizing your queries, or eliminating queries
completely - assuming you haven't done so already.
For example, rather than running a query that returns say, 1000 records
from table A, and then running a second query for each of those 1000
records against table B, it can be a lot more efficient to grab the
entire applicable contents of the tables you are working with via two
simple queries (select * from ). The resulting recordsets would then be
iterated through and the data stored in internal data structures within
PHP, and then operations on those native objects can be used to do your
data processing rather than making thousands of "expensive" calls to a
database.
You can even take this a step farther, and cache these local
representations of your data for a period of time, allowing the code to
process multiple requests without having to go out to the database each
time.
Granted, you have to write more code, but you are also avoiding taxing
your database and making your user(s) wait (not to mention increasing
the scalability of your application).
Brian wrote:
Hi there
I'm not so hot on JavaScript so not sure if this can be done.
I have a PHP page that runs a MySQl query, while these queries
are running I would like to show a message saying 'Processing....'
once the query has finished running the message disappears.
I was thinking of showing then hiding a layer, but I don't know
how to say, show this message at a set point eg below the
select box on the screen
Brian