Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Feb 2012
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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.

  • #2
    New Coder
    Join Date
    Jan 2012
    Posts
    12
    Thanks
    0
    Thanked 4 Times in 4 Posts
    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

  • #3
    New to the CF scene
    Join Date
    Feb 2012
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •