Go Back   CodingForums.com > :: Server side development > MySQL

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 02-05-2012, 01:53 PM   PM User | #1
Phoenix649
New to the CF scene

 
Join Date: Feb 2012
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Phoenix649 is an unknown quantity at this point
Question MySQL records change on same page

Hi folks, hope someone can help me with this.
I've created a database where I can select various results to be displayed from a menu. No problem displaying them on a different page, but I want them to appear on the same page. The links are in an area called division A. I need the results to appear in division B. Think of it as 2 columns. Column A shows the links, Column B shows the results. When someone clicks on a link, the found result appear in column B. When another link is clicked, the old results disappear and the new results appear. This one has me stumped and I could really use help here. Thank you.
Phoenix649 is offline   Reply With Quote
Old 02-05-2012, 03:27 PM   PM User | #2
theghostofc
New Coder

 
Join Date: Jan 2012
Posts: 12
Thanks: 0
Thanked 4 Times in 4 Posts
theghostofc is an unknown quantity at this point
hii Phoenix649

You need to use AJAX for this. Create another PHP page to return the result of a link. Just echo the output to be printed on the HTML page.

Now, on click of the link call XmlHttpRequest to call the result page with the link and show the output in the result div, just set the innerHTML and it would replace the old content with new one.

References:
http://www.tizag.com/ajaxTutorial/ajaxphp.php
http://www.w3schools.com/php/php_ajax_database.asp
http://www.ajaxf1.com/tutorial/ajax-php.html

Hope this helps!

Cheers
theghostofc is offline   Reply With Quote
Old 02-06-2012, 02:26 PM   PM User | #3
Phoenix649
New to the CF scene

 
Join Date: Feb 2012
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Phoenix649 is an unknown quantity at this point
Hi theghostofc
Appreciate the feedback.
I took your advice and managed to get it working using an Ajax routine.
Still new at coding the MySQL and doing OK except for putting periods instead of commas. Guess my fingers are not as adept as they used to be.
Thanks again.
Phoenix649 is offline   Reply With Quote
Reply

Bookmarks

Tags
links, mysql, php, refresh

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 10:58 AM.


Advertisement
Log in to turn off these ads.