Solved

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

Posted on 2010-11-24
5
574 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 167 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 167 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 110

Assisted Solution

by:Ray Paseur
Ray Paseur earned 166 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

Don't Cry: How Liquid Web is Ensuring Security

WannaCry is just the start. Read how Liquid Web is protecting itself and its customers against new threats.

Question has a verified solution.

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

Although a lot of people devote their energy toward marketing for specific industries, there are some basic principles that can be applied to any sector imaginable. We’ll look at four steps to take and examine how those steps were put into action fo…
When it comes to security, close monitoring is a must. According to WhiteHat Security annual report, a substantial number of all web applications are vulnerable always. Monitis offers a new product - fully-featured Website security monitoring and pr…
This tutorial demonstrates how to identify and create boundary or building outlines in Google Maps. In this example, I outline the boundaries of an enclosed skatepark within a community park.  Login to your Google Account, then  Google for "Google M…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

734 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