Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PHP AJAX singe frame refresh (with MySQL update)

Status
Not open for further replies.
Apr 27, 2006
126
GB
Hi,

Hopefully this is the right place to ask this and you can help.

I won't (yet) dump any of the code we have written as 1) It doesn't work and 2) I feel we may have gone about this the wrong way and need to start from scratch. (i'll point out that we have all the MySQL stuff working fine, it's just the page refreshes that we are havnig issues with)

Goal (simplified):

A PHP page, arranged with css. Divided into 4 sections, each a named <div>.

In frame 1 we have a button which performs the following actions:
Code:
*Update a record in the DB (for this example, increase X integer by 1)

*Re-load frame 2 (which will query the DB for the value of X and display it)

*Re-load frame 1 (which will query the DB again as it loaded the first time, pulls various things back from the DB)

*NOT refresh any other frame other than 1 & 2  (this is our stumbling block)

It's clear that AJAX is the way forward, but we just can't seem to get it working, there are tutorials out there and we keep thinking we have it working, then we test it in IE6 and notice (due to slower page load times) that it is refreshing every frame (either that, or it's re-loading the background image on top and then sending it to the back, but I have no idea)

We have played so much it's getting to the point that we don't know what we have and haven't tried and we could really just do with some pointers so help us get started.


note: I am not schizophrenic, "we" is myself and a friend.


Thanks in advance for any advice.

________
clueless
 
ah brilliant, did a search for ajax forum but it didn't return anything.. strange.

Thanks for that, i'll re-post there

________
clueless
 
In the same token, if using PHP, I strongly recommend using XAJAX ... It is a heavenly simple to use and it is PHP code which you can use within your existing PHP scripts in less than 1 hour (no JS knowledge required).

Here is a link where you can get it:
Code:
[URL unfurl="true"]http://sourceforge.net/project/showfiles.php?group_id=139736[/URL]

I have been using it with great success and w/out any previous ajax knowledge managed to integrate it and successfully use it to do the very things you want to do and then some.

Hope this helps!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top