troubleshooting Question

How to use ajax in jquery to retrieve information from a database?

Avatar of FairyBusiness
FairyBusinessFlag for United States of America asked on
57 Comments2 Solutions563 ViewsLast Modified:
Hi, I would like to retrieve information from my database using ajax in jquery.  I googled this but I have not found a tutorial for exactly what I am trying to do.  (also, many of them had or C# in them, which I am not familiar with yet)

I know how I would normally retrieve info from the database with php:  (example)

      $query = "SELECT name FROM submenus WHERE id=" . $id;
      $result = mysql_query($query, $conn);
    while ($row = mysql_fetch_assoc($result)){
                        $name = $row['name'];

but if you want this to change each time according to an item being clicked the page would have to reload.  I would like to display information (details) next to an image (according to the image that is clicked) without the page reloading.

Can anyone tell me a real SIMPLE way of retrieving data from a database or know of a good tutorial for this (jquery/ajax/php)?
Join our community to see this answer!
Unlock 2 Answers and 57 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 57 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros