Real-time database monitor

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Justin Voelker

    Real-time database monitor

    I have built a messaging system where users of a website can send
    messages to each other and they will appear in the other users inbox
    for viewing next time they log in. In a bar at the top of the page it
    says "Inbox (0)" if they have no new messages and, yup, you guessed it
    "Inbox (2)" if they have two waiting messages. If someone sends them
    a message while they are sitting on some page of the website I would
    like the counter to increase. Right now the mysql query runs each
    time a page is loaded so they would be notified then but I would like
    it to somehow update the inbox number while they sit on a page. Does
    anyone have any ideas? Thank you in advance for your help!
  • Justin Voelker

    #2
    Re: Real-time database monitor

    On May 7, 8:33 pm, Justin Voelker <justin.voel... @gmail.comwrote :
    I have built a messaging system where users of a website can send
    messages to each other and they will appear in the other users inbox
    for viewing next time they log in. In a bar at the top of the page it
    says "Inbox (0)" if they have no new messages and, yup, you guessed it
    "Inbox (2)" if they have two waiting messages. If someone sends them
    a message while they are sitting on some page of the website I would
    like the counter to increase. Right now the mysql query runs each
    time a page is loaded so they would be notified then but I would like
    it to somehow update the inbox number while they sit on a page. Does
    anyone have any ideas? Thank you in advance for your help!
    I forgot to mention that each time someone sends a message it creates
    a new record in a single table in the database. What I am looking for
    is a way to monitor that database and find any records with "msg_to"
    equal to the user id of the person logged in and "msg_unread " equal to
    '1.'

    Comment

    • Jerry Stuckle

      #3
      Re: Real-time database monitor

      Justin Voelker wrote:
      I have built a messaging system where users of a website can send
      messages to each other and they will appear in the other users inbox
      for viewing next time they log in. In a bar at the top of the page it
      says "Inbox (0)" if they have no new messages and, yup, you guessed it
      "Inbox (2)" if they have two waiting messages. If someone sends them
      a message while they are sitting on some page of the website I would
      like the counter to increase. Right now the mysql query runs each
      time a page is loaded so they would be notified then but I would like
      it to somehow update the inbox number while they sit on a page. Does
      anyone have any ideas? Thank you in advance for your help!
      >
      You aren't going to be able to do this unless they refresh the screen.
      The browser knows nothing about changes on the server.

      AJAX can help. Try comp.lang.javas cript.

      --
      =============== ===
      Remove the "x" from my email address
      Jerry Stuckle
      JDS Computer Training Corp.
      jstucklex@attgl obal.net
      =============== ===

      Comment

      Working...