www.webdeveloper.com
Results 1 to 5 of 5

Thread: Ajax PHP Database Request

  1. #1
    Join Date
    Oct 2013
    Posts
    17

    Red face Ajax PHP Database Request

    Hello Guys,

    I want to code a product site where the products will read out of a database and will show via ajax. The loading process should done with ajax.

    My Questions ist how can I do that? Please describe it verbal, that should be enough for me.

    Regards.

  2. #2
    Join Date
    May 2006
    Location
    Somewhere behind your screen
    Posts
    1,648
    you will need a php script which can pick up from the DB product info according to parameters it gets via the $_GET request and then echo the result back to the browser. also you will need a javascript function which makes ajax requests to that php script and after success puts the result (the echoed data) into certain element on the page
    xxx: Guess Buddhist riddle: "What is the sound of one hand clapping?"
    yyy: facepalm

  3. #3
    Join Date
    Oct 2013
    Posts
    17
    Thank you. It sounds logical. How does the function called which makes ajax requests?

  4. #4
    Join Date
    May 2006
    Location
    Somewhere behind your screen
    Posts
    1,648
    as for me i prefer using jQuery $.get or $.post for that purpose but there exist other 'pure javascript' variants (some further reading).
    xxx: Guess Buddhist riddle: "What is the sound of one hand clapping?"
    yyy: facepalm

  5. #5
    Join Date
    Mar 2007
    Location
    localhost
    Posts
    2,204
    I recently used a Vanilla framework, personally I don't like them (frameworks that is) but to get my script to the next level I used it. I now have time to craft my own script.

    You might want to look in to getting a server side script operational vai a regular form so you know what works and what needs fixing.

    Then sort your AJAX out to post / get and return the values you want, then build your page around that.
    Yes, I know I'm about as subtle as being hit by a bus..(\\.\ Aug08)
    Yep... I say it like I see it, even if it is like a baseball bat in the nutz... (\\.\ Aug08)
    I want to leave this world the same way I came into it, Screaming, Incontinent & No memory!
    I laughed that hard I burst my colostomy bag... (\\.\ May03)
    Life for some is like a car accident... Mine is like a motorway pile up...

    Problems with Vista? :: Getting Cryptic wid it. :: The 'C' word! :: Whois?

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles