JP128 Posted December 19, 2006 Share Posted December 19, 2006 I made a change password script, and when the user clicks submit, it automatically updates the date_joined to the current time... is there anyway to stop this? Link to comment https://forums.phpfreaks.com/topic/31211-solved-timestamp-updates-by-itself/ Share on other sites More sharing options...
chiprivers Posted December 19, 2006 Share Posted December 19, 2006 Where is your script? You must have set it to update the column holding this information! Link to comment https://forums.phpfreaks.com/topic/31211-solved-timestamp-updates-by-itself/#findComment-144312 Share on other sites More sharing options...
JP128 Posted December 19, 2006 Author Share Posted December 19, 2006 $password = $_POST['password'];mysql_query("UPDATE users SET password=md5('$password') WHERE username='$username'");}$firstname = $_POST['firstname'];$lastname = $_POST['lastname'];$email = $_POST['email'];$biography = $_POST['biography'];$location = $_POST['location'];mysql_query("UPDATE users SET firstname='$firstname' WHERE username='$username'");mysql_query("UPDATE users SET lastname='$lastname' WHERE username='$username'");mysql_query("UPDATE users SET email='$email' WHERE username='$username'");mysql_query("UPDATE users SET biography='$biography' WHERE username='$username'");mysql_query("UPDATE users SET location='$location' WHERE username='$username'");} Link to comment https://forums.phpfreaks.com/topic/31211-solved-timestamp-updates-by-itself/#findComment-144314 Share on other sites More sharing options...
chiprivers Posted December 19, 2006 Share Posted December 19, 2006 I just had a look at MySQL reference and you can set the column in your database table to update with the current time stamp when the record is updated, you must have done this! You will need to amend the relevent column:ALTER TABLE tablename MODIFY columnname DATETIMEAbove is the syntax to change the data type of your relevant column to a datetime value without any additional auto update settings. Link to comment https://forums.phpfreaks.com/topic/31211-solved-timestamp-updates-by-itself/#findComment-144315 Share on other sites More sharing options...
JP128 Posted December 19, 2006 Author Share Posted December 19, 2006 Thanks, that worked like a charm. Link to comment https://forums.phpfreaks.com/topic/31211-solved-timestamp-updates-by-itself/#findComment-144317 Share on other sites More sharing options...
chiprivers Posted December 19, 2006 Share Posted December 19, 2006 I had to do another post so that I gone one more total posts than you JP128!! ;D ;D Link to comment https://forums.phpfreaks.com/topic/31211-solved-timestamp-updates-by-itself/#findComment-144318 Share on other sites More sharing options...
JP128 Posted December 19, 2006 Author Share Posted December 19, 2006 Hah, I made a new topic, and with this post, 141! yah! Link to comment https://forums.phpfreaks.com/topic/31211-solved-timestamp-updates-by-itself/#findComment-144320 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.