Jump to content

Updated By


mulaus

Recommended Posts

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...

Link to comment
https://forums.phpfreaks.com/topic/280973-updated-by/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.