Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2003
    Location
    Vietnam
    Posts
    188

    Unanswered: notified when a new record is added

    can anyone can help me a way to know when a new record is added to a table, something like in this forum, when a reply added for a post, all involved members are notified by email

    i am writing an app that need to alert user of newly-added/ comming request.

    any idea, any one?

    TIA
    qha_vn

  2. #2
    Join Date
    Jun 2003
    Posts
    21

    Re: notified when a new record is added

    Originally posted by qha_vn
    can anyone can help me a way to know when a new record is added to a table, something like in this forum, when a reply added for a post, all involved members are notified by email

    i am writing an app that need to alert user of newly-added/ comming request.

    any idea, any one?

    TIA
    By my knowledge MySQL doesn't have any methods for this. Incorporate some warning system in your app. A simple way would be for a seperate thread to check the DB for new post every x minutes.

  3. #3
    Join Date
    Sep 2002
    Location
    Montreal, Canada
    Posts
    224
    Provided Answers: 1

    Re: notified when a new record is added

    Originally posted by qha_vn
    can anyone can help me a way to know when a new record is added to a table, something like in this forum, when a reply added for a post, all involved members are notified by email

    i am writing an app that need to alert user of newly-added/ comming request.

    any idea, any one?

    TIA
    Add a timestamp column to your table (Timestamps in MySQL are updated automatically everytime you modify, or insert, a row) and scan it at regular intervals to select rows with timestamp > last scan time

    Not elegant but simple and it works

  4. #4
    Join Date
    Jan 2003
    Location
    Vietnam
    Posts
    188
    Thanks a lot, that will work actually

    cheers
    qha_vn

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •