Quantcast
Channel: PHP Freaks: PHP Help
Viewing all articles
Browse latest Browse all 13200

Updated By

$
0
0
Hi
 
i would like to display in my data table the user who last updated the data
 
I have this example
 
$updated_by = $myUser->getVar('name'); 
 
 
echo "<input type='hidden' name='updated_by' value='$updated_by'>";
 
 global $myDB;  
 
mysql_query("UPDATE ".$myDB->prefix("kmb_info")."
 
SET name='" . mysql_escape_string(trim($_POST['name']))  . "',
 
updated_by='" . mysql_escape_string(trim($_POST['updated_by']))  . "'
 
WHERE id='".intval($id)."'") or die(mysql_error()); 
 
 
the problem is field updated_by is updated even when no change in name value when the
edit form is submitted
 
how do i do this..im new to this
 
TQ...

Viewing all articles
Browse latest Browse all 13200

Trending Articles