Comparing values before and after POST

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • s2mo
    New Member
    • Sep 2006
    • 3

    Comparing values before and after POST

    Hi, I have a 'helpdesk' form that collects information and then posts to a MySQL database. All works fine.

    The site has an edit function that can retrieve the database information for a heldesk call and allow fields to be edited. This all works ok too. One of the fields is called 'solved' and when this is set to 'on' I want a field called 'DateSolved' to update with todays date. I don't know how to reference the 'solved' value stored at the same time as posting the newly inputted 'solved' value so that I can compare before and after values and then update the DateSolved field when appropriate.

    Any ideas?

    Thanks
  • s2mo
    New Member
    • Sep 2006
    • 3

    #2
    OK, problem solved due to in-shower revelation: I just had to test the posted field for a change and then what kind of change with a nested 'if'.


    if (isset($Solved) ) {
    if ($Solved == 'on') {
    $tUnixTime = time();
    $sGMTMySqlStrin g = gmdate("Y-m-d H:i:s", $tUnixTime);
    $SolvedDate = $sGMTMySqlStrin g;
    }
    }

    Comment

    Working...