dcsimg
www.webdeveloper.com
Results 1 to 5 of 5

Thread: Ajax PHP Database Request

Hybrid View

  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,686
    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

  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,686
    as for me i prefer using jQuery $.get or $.post for that purpose but there exist other 'pure javascript' variants (some further reading).

  5. #5
    Join Date
    Mar 2007
    Location
    localhost
    Posts
    2,591
    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.
    If your post falls off the page, bump it. ...
    Please remember to wrap any code you have in forum tags:-

    [CODE]...[/CODE] [HTML]...[/HTML] [PHP]...[/PHP]

    If you can't think outside the box, you will be trapped forever with no escape...

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