show live SQL resultes

Discussion in 'Databases' started by roice, Mar 31, 2011.

  1. #1
    Hello,
    I have store and I want to add box on the page that show if some product is still available.
    Is it possible to print the number of product items left liveon the page ?
    live mean - if someone buy product, the box will show the new total without refreshing for the other visitors...
    ?

    Thank you in advanced,
    Roi.
     
    roice, Mar 31, 2011 IP
  2. roice

    roice Peon

    Messages:
    200
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I'll tell why I need that: I have store with 10 products. because some ad I publish I got 1000 users that enter to my store and want in the same time to buy it.
    So in the first second they all see that I have products to sell, but during the buy progress stock may end and I need to print the right msg...
     
    roice, Mar 31, 2011 IP
  3. AstarothSolutions

    AstarothSolutions Peon

    Messages:
    2,680
    Likes Received:
    77
    Best Answers:
    0
    Trophy Points:
    0
    #3
    The web is generally a Pull technology, you need the browser to request a new page/ piece of data rather than having the server Push the page/ data to the web browser.

    There are ways around it (see http://en.wikipedia.org/wiki/Push_technology ) but most simply use AJAX to see if there is an update every second or two but this can create a heavy load if your getting a lot of concurrent users.
     
    AstarothSolutions, Apr 4, 2011 IP