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."'"); Quote 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? Quote 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. Quote Link to comment https://forums.phpfreaks.com/topic/218434-stamp-time-update/#findComment-1133252 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.