RON_ron Posted November 11, 2010 Share Posted November 11, 2010 Can I stamp the time when doing a UPDATE? Please show me how. $SomeVar = $_POST['finco']; mysql_query("UPDATE dxone SET und1='$cha', und2='$chb', und3='$chc' WHERE username = '".$SomeVar."'"); Link to comment https://forums.phpfreaks.com/topic/218434-stamp-time-update/ Share on other sites More sharing options...
joel24 Posted November 11, 2010 Share Posted November 11, 2010 stamp the current time? time(); returns current unix timestamp. or do you want to use the time in the sql query somewhere? Link to comment https://forums.phpfreaks.com/topic/218434-stamp-time-update/#findComment-1133214 Share on other sites More sharing options...
Pikachu2000 Posted November 11, 2010 Share Posted November 11, 2010 If the field is the appropriate type, you can use `field` = NOW() in the query string. You can also alter the field, or add another field and define it with ON UPDATE CURRENT_TIMESTAMP. Look at MySQL's timestamp functions and I'm sure you'll find the right way for your application. Link to comment https://forums.phpfreaks.com/topic/218434-stamp-time-update/#findComment-1133252 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.