too long

I have created a web application using PHP and MySQL. I am looking for a good way to implement some user data tracking. I want it so that when a user changes a field, I would be able to display the change with some like "John Doe has changed Close Date from 6/5/2012 to 6/13/2012"

I can't think of a good, easy way to do this. Anyone have any suggestions?

This will do what you're looking to do, I didn't use a database connection so you could see this work exactly as given to you, but subbing in a database connection and data should be easy to see how that would work. I added in encryption just in case you're working with people who would benefit from being able to change the data without any "notice" to anyone (grabbed from Simple encryption in PHP) You could omit that entirely if it isn't needed. Essentially, it is just storing the data in a hidden field on the page and comparing it after the submission to see what was changed. HTH

<?php
function ecrypt($str){
  $key = "something simple";
  for($i=0; $i<strlen($str); $i++) {
     $char = substr($str, $i, 1);
     $keychar = substr($key, ($i % strlen($key))-1, 1);
     $char = chr(ord($char)+ord($keychar));
     $result.=$char;
  }
  return urlencode(base64_encode($result));
}


function decrypt($str){
  $str = base64_decode(urldecode($str));
  $result = '';
  $key = "something simple";
  for($i=0; $i<strlen($str); $i++) {
    $char = substr($str, $i, 1);
    $keychar = substr($key, ($i % strlen($key))-1, 1);
    $char = chr(ord($char)-ord($keychar));
    $result.=$char;
  }
return $result;
}



if (isset($_POST['update']) && $_POST['update']!='') {
    $data1=$_POST['data1'];
    $data2=$_POST['data2'];
    $data3=$_POST['data3'];

    $datahide1=decrypt($_POST['datahide1']);
    $datahide2=decrypt($_POST['datahide2']);
    $datahide3=decrypt($_POST['datahide3']);

    $msg='';
    if ($data1!=$datahide1) {
        $msg.="John Doe has change name from ".$datahide1." to ".$data1."<br>";
    }
    if ($data2!=$datahide2) {
        $msg.="John Doe has change price from ".$datahide2." to ".$data2."<br>";
    }
    if ($data3!=$datahide3) {
        $msg.="John Doe has change date from ".$datahide3." to ".$data3."<br>";
    }

    // do your database update here

    // do your results here
    if ($msg!="") {
        echo $msg;
    } else {
        echo "No changes";
    }
    die();
} 

// Database recordset here

// Junk data
$data1="John Doe";
$data2="25.00";
$data3="6/5/2012";

// encypted data
$datahide1=ecrypt($data1);
$datahide2=ecrypt($data2);
$datahide3=ecrypt($data3);

?>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
</head>

<body>
<form name="form1" method="post" action="revisiontrack.php">
    <label for="data1">Name:</label>
    <input type="text" name="data1" id="data1"><input name="datahide1" type="hidden" value="<?php echo $datahide1;?>">
    <label for="data2">Price:</label>
    <input type="text" name="data2" id="data2"><input name="datahide2" type="hidden" value="<?php echo $datahide2;?>">
    <label for="data3">Date:</label>
    <input type="text" name="data3" id="data3"><input name="datahide3" type="hidden" value="<?php echo $datahide3;?>">
    <input name="update" type="hidden" id="update" value="y">
<input type="submit" name="submit" id="submit" value="Submit">
</form>
</body>
</html>