www.webdeveloper.com
Results 1 to 4 of 4

Thread: Scenario using Ajax + PHP

  1. #1
    Join Date
    Sep 2009
    Posts
    2

    Question Scenario using Ajax + PHP

    Hello guys, I've been assigned to implement a web client for a certain DB application working on top of Oracle. Unfortunately I'm not very experienced on web development.

    My application has a terminal/console (kind of the Linux one), in which every operation can be performed used a certain syntax. But the application also has the option of defining the things using web forms, then it will be traduced to the underlying application syntax and, finally, executed.

    When the operation is executed in the DB, the DB system will insert some data in certain tables. I need to get that data in the web but without refreshing the web page (I don't want to lose the forms the user filled in). So I send an Ajax request that calls a PHP script which will perform the operation. ONce I get response from the Ajax request (so far I just send back a number indicating if everything went right or not in the DB), I have to show the data inserted by the PHP script in some tables. And here I have the problem. How can I do this? Because I get the response in the Ajax method, but I should use PHP again to perform a SELECT and show the results... but how? Do I have to do this by using Javascript and creating every single node in the DOM? IS there any other way?

    Any idea or hint on how to do this sort of things would be really appreciated!
    Thanx!

  2. #2
    Join Date
    Jan 2009
    Posts
    3,346
    You could use innerHTML and just have the php spit out the html markup as well (though many on this board might poo poo the idea).

  3. #3
    Join Date
    Sep 2009
    Posts
    2
    Thanks for you answer!

    That seems like a solution, maybe the fastest one. But another thing is that the SELECT query could return thousands of registers, so charging all of them would be very inefficient. I guess it would be better to execute the SELECT back in the web page and perform some kind of pagination on the data in case there are too much registers...

    Maybe what I'm asking for is simply not possible without refreshing the webpage? I dont know..

  4. #4
    Join Date
    Jan 2009
    Posts
    3,346
    You can do pagination with ajax. Do a quick search on google for "pagination ajax php" and I'm sure something will come up to help you.

Thread Information

Users Browsing this Thread

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

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
  •  
HTML5 Development Center



Recent Articles