Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How to show a loading icon during a long query of a DB?

Posted on 2010-11-24
5
Medium Priority
?
582 Views
Last Modified: 2012-05-10
Experts,

I have an sql query that takes some time to execute due to the size of the database and complexity of the query.  Is there anyway to show a loading graphic while this query is doing it's thing?

Cheers!

EVM
0
Comment
Question by:evibesmusic
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 9

Accepted Solution

by:
Vampireofdarkness earned 668 total points
ID: 34208424
As far as I am aware there is not via PHP. You could, however, use AJAX to execute the query and return a JSON/XML confirmation when it has succeeded and show a loading graphic that way.

jQuery (jquery.com), a popular JS library, has some very easy to use AJAX functions with customisable start (when ajax starts) and completion (when the ajax request is completed) functions -- ie, when AJAX starts, display a loading graphic and when it stops you hide the graphic.

Obviously with this method your page needs to load in order to start the AJAX request and you'll need to verify the success/failure based on the JSON/XML response.
0
 
LVL 2

Assisted Solution

by:marceloOrigoni
marceloOrigoni earned 668 total points
ID: 34212471
You must use a javascript library, I use mootools, you just need to add a onRequest and oncomplete event, to an HTML Request.

http://www.mootools.net/docs/core/Request/Request.HTML

Marcelo
0
 
LVL 111

Assisted Solution

by:Ray Paseur
Ray Paseur earned 664 total points
ID: 34213076
Google "jQuery Progress Bar" and you may find some good stuff.  You might also consider using just a little bit of CSS to style the "loading" message.  When the page completes, you could hide the message with a bit of JavaScript to modify the CSS.
0
 

Author Comment

by:evibesmusic
ID: 34261928
@All:

Thanks for your input...I am checking into each of the methods suggested above.  This question has not been abandoned.

Thanks.
EVM
0
 

Author Comment

by:evibesmusic
ID: 34320667
@All:

I am currently using Prototype to handle my ajax requests.  I was able to use Prototype to do what I needed to do.

Thank you for your suggestions, I am sure that each of them are viable in there own ways.

Points to all.  Cheers!
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
What we learned in Webroot's webinar on multi-vector protection.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …

661 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question