Notifying users when a record hits a MYSQL databse

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • gnawz
    New Member
    • Nov 2006
    • 64

    Notifying users when a record hits a MYSQL databse

    Dear experts

    I need help on how to notify users in a website when some one else logs in or
    when a record has gone into the database.
    Something like a pop-up or sound beep

    can someone help?
  • rizwan6feb
    New Member
    • Jul 2007
    • 108

    #2
    You should use AJAX to check for the changes in the database. If a certain condition is met, show the pop-up using Javascript. Keep in mind, you have no access to user 's browser from PHP. There must be a script running on the client (browser) to communicate with the PHP script on the server.

    Comment

    • Atli
      Recognized Expert Expert
      • Nov 2006
      • 5062

      #3
      Hi.

      Like the above post mentions...
      Your PHP code has no control over what is happening in your client's browser. Once the PHP code has been executed and the output sent to the browser, your PHP code is no longer in control.

      The best way, as suggested above, would probably be to have AJAX request a PHP script from the server, which would check whatever it is you need checking and return the results to the browser.

      Comment

      Working...