Nitifying logged in user after function execution

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

    Nitifying logged in user after function execution

    I have a database for posting a new record.
    I have a field for status.
    Every time a new record is added to the table the status for unread is 1 while that for read is 2.

    I want a user to be notified while he/she is logged in by a sound or pop-up whenever a new record has been
    added or when status has changed ie when an update takes place.

    PLEASE HELP.

    My update code is something like this:


    $sql = 'UPDATE exportatltable SET Depot="'.$_POST["Depot"].'",
    CustomerName="' .$_POST["CustomerNa me"].'",Address="'. $_POST["Address"].'",EmailAddres s= "'.$_POST["EmailAddre ss"].'",
    Country="'.$_PO ST["Country"].'",Product1="' .$_POST["Producta"].'",Product2="' .$_POST["Productb"].'",Product3="' .$_POST["Productc"].'",
    TotalProductQua ntity="'.$_POST["TotalQuant ity"].'",
    TotalPrice="'.$ _POST["TotalPrice "].'",TruckDetail s="'.$_POST["TruckDetai ls"].'",Destination = "'.$_POST["Destinatio n"].'",
    PreparedBy="'.$ _POST["PreparedBy "].'",AuthorisedB y="'.$_POST["Authorised By"].'",AccountBf=" '.$_POST["Accountbf"].'",
    AmountRecieved= "'.$_POST["AmountReceived "].'",LessThisOrd er="'.$_POST["LessThisOr der"].'",Balance="'. $_POST["Balance"].'",
    Currency="'.$_P OST["Currency"].'",Narration=" '.$_POST["Narration"].'",FinanceNote ="'.$_POST["FinanceNot e"].'",Status = 1, Date = Now() WHERE PfiNo="'.$_POST["PfiNo"].'"';
    $query = mysql_query($sq l);

    I want a pop-up or sound or any other form of notification to any user logged in whenever
    this code is executed successfully!

    AFNY IDEAS??
  • kovik
    Recognized Expert Top Contributor
    • Jun 2007
    • 1044

    #2
    If you want it to be live, you'll need to use AJAX at predefined intervals. If you just want a notification upon page load, just query the database for new posts and, if there is at least one, display the notification.

    And as for the sound... That'd be half-pointless, the other half being annoying.

    Comment

    • gnawz
      New Member
      • Nov 2006
      • 64

      #3
      help on this .....

      "AJAX at predefined intervals"

      Comment

      • kovik
        Recognized Expert Top Contributor
        • Jun 2007
        • 1044

        #4
        Originally posted by gnawz
        help on this .....

        "AJAX at predefined intervals"
        .... What part don't you understand?

        Comment

        Working...