PHP Mysql & Jquery data extraction

Hi guys. I have been dealing with a page refresh issue. I am creating this website for my brother: http://javierbooks.com and the refresh time makes the page to flick and every click on each menu link.

The page contains two main functions menuDisplay() and contentDisplay(). The first one generates the menu buttons from MYSQL, and the second one generates the corresponding content page for each button. Someone suggested that I used AJAX to deal with the refresh issue. I have never used AJAX beefore, so I started searching for implementations.

I came across a youtube tutorial (http://www.youtube.com/watch?v=v8HoVdenZFM) that actually uses Jquery to proces data from a form withot refreshing the page. However, I am not sure how can I adapt this script when your data is coming straight from PHP&MYSQL without form intervention. Again, in my case the two functions get the data for me.

Here’s the PHP page with the JQuery script:

[php]

PHP & JQUERY

[/php]

And here’s the second page that the data is being pulled from.

[php]$name = mysql_real_escape_string($_POST[‘name’]);

$name =$_POST[‘name’];[/php]

Again, my main concern is how to use the two function that populate my page into the the Div (age in this case) so JQuery can process them first, and avoid the refresh or page flicks that I am getting. Using a form to get values from MYSQL does not work for the current implementation of my website.

I hope this is clear, and thanks everyone for all the good work and help here and phpHelp.

Sponsor our Newsletter | Privacy Policy | Terms of Service