473,803 Members | 3,758 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Hide and Show message

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

Jul 23 '05 #1
4 2860


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.
Generally, the page won't be sent to the browser until all the
processing is finished anyway. You can try to send something to
the browser before the processing begins, using ob_flush() and
flush(), but there's no guarantee that it will appear on the
browser because of buffering that takes place both at the server
and the browser.

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


There are a couple ways you could do that. You could either set
the style property to display:none and display:block to hide or
show the element that carries the message. Or you could just
change the innerHTML property of the element.

But neither will work in your case, because the PHP script that
generates the page probably won't appear until it's all finished
processing.

Jul 23 '05 #2
Jc
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


Jul 23 '05 #3


Jc wrote:
The root problem may very well be inefficient SQL query usage, which if
fixed, would negate the need for a progress message altogether.
No, it would not. Whenever a program has to communicate with another
one
over a network, there is the possibility that the other one is out to
lunch, on vacation, under attack, etc...

It's generally good practice to display a "busy" message whenever an
operation could take some time, and to have a timeout function as well.
This isn't the easiest thing to do when a page submits a form with
itself
as the target, of course. But...
You may
want to spend some time optimizing your queries, or eliminating queries
completely - assuming you haven't done so already.


Sure. Of course. We should optimize everything always. And plan for
less
than optimum results.

Jul 23 '05 #4
Hi Guys

I have done it by showing and hiding a layer. The trouble is not
the statement, that is fine, the trouble is it has to look though
40,000 record and do a load of calculation, that's what's slowing it
down.

When the form is submitted (back to it's self ) I top of the page loads
OK, then it starts the SQl stuff, just before it I show the layer, once
it's finished it hides it.

Brian


"Razzbar" <gl***@potatora dio.f2s.com> wrote in message
news:11******** **************@ g44g2000cwa.goo glegroups.com.. .


Jc wrote:
The root problem may very well be inefficient SQL query usage, which if
fixed, would negate the need for a progress message altogether.


No, it would not. Whenever a program has to communicate with another
one
over a network, there is the possibility that the other one is out to
lunch, on vacation, under attack, etc...

It's generally good practice to display a "busy" message whenever an
operation could take some time, and to have a timeout function as well.
This isn't the easiest thing to do when a page submits a form with
itself
as the target, of course. But...
You may
want to spend some time optimizing your queries, or eliminating queries
completely - assuming you haven't done so already.


Sure. Of course. We should optimize everything always. And plan for
less
than optimum results.

Jul 23 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
4722
by: Doug van Vianen | last post by:
Hi, I am using Choice to provide a dropdown menu in an Applet. I create the Choice and then need to hide it until it is needed and then show it. I use c.hide() and c.show() where 'c' is the choice. This works fine except that when I use javac to compile the code I get the message that I am using a deprecated API. That is, hide() and show() for choices (and presumably other items) is no longer used. I have tried doing a search to find...
13
74145
by: genetic.error | last post by:
I'm moving from Vb6 to VB.Net. I have a feeling this has come up before... The VS.Net MSDN file seems to state that the following should work: Form1.Show Form1.Visible = True Form1.Hide Form1.Visible = False Load (Form1)
10
3217
by: David | last post by:
Hi everyone, Hoping there are some .js/browser experts out there that can help with this weird problem. I have made a swap div routine and applied the events to menu buttons with a closer layer behind the menus. The closer div has a lower index than the submenu divs so it appears behind them. The closer div contains a transparent gif with an event applied to it to close all of the divs when moused over.
2
12192
by: MOHSEN KASHANI | last post by:
Hi, I am trying to hide some form elements in a form by default and show/hide depending on which radio button is clicked. This is what I have but it is not working: <head> <style> ..noshow { display: none; }
7
29156
by: FP | last post by:
I'm new to Java Script. I'm displaying comments people have made. Below each persons' comment I want to add 2 buttons "Reply" and "Amend". Clicking "Reply" would display an empty text field below the comment with a spell check & submit button. Clicking "Amend" would display the same buttons & text field but pre-populated with the original comment. Using Java Script how do I show / hide the text field in my list of comments but have...
13
2267
by: jeff | last post by:
I am attempting to be able to show and hide a form called viewAllForm. I declared an instance of the form in a module. Public viewAllForm As New frmViewAll However I keep getting runtime errors when I close and try and show it again. What is the proper way to do this? I only want 1 open at a time. They can cover it up and leave it open if they want. But whenever they click to show it I want it to come to the surface and/or to load if it...
5
8441
by: ali | last post by:
Hello every one i need you help regarding div hide and show. i am having a link like <a href="#" onClick="expandWin()">show/hide </a> <div id=showHide> </div> within div i have lots of form tags and div elements say n. The problem
1
4175
by: pamate | last post by:
hi, I want to show hide layers. I am able to show and hide layers but i am facing problem that, cant view the cursor in Mozilla,but i can type in input text box, its overlapping the layers. I don`t want to change the way i have used to show and hide layers. check down code :- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html...
10
11772
by: sara | last post by:
Hi - Is it possible to hide the detail section of a report at run time? I have a report that prints all details, with summary lines. The user would like the report ALSO with just summary lines. It seems the simplest thing is to run the code (see below) once with the detail section showing, and a second time hiding the detail section. I can't figure out the code to do that and don't see it posted.
6
3219
by: Doogie | last post by:
Hi I have an img control I am trying to hide upon certain types of commands in my code behind. When to hide it is directly tied to a asp:dropdownlist control. So depending on what the user selects in that dropdownlist, this image will be hidden or be displayed. I have tied the onselectedindexchanged value of the dropdownlist to a c-sharp method (not javascript) because other things are being done as well that I want to do server side. ...
0
10310
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10068
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9121
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6841
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5498
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5627
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4275
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3796
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2970
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.