manibalan.v Posted January 20, 2012 Share Posted January 20, 2012 hai this is mani,i am new to php and mysql ...first of all forgive for my english...i am having problem with my mysql .i am having a table 'user' and fields 'id','name','status' .i can enter the values to the table. for example.... id=1,name="db' status='first' what i need is i have to update the status value to 'second' automatically after one year. how can i do that? :-\ Quote Link to comment https://forums.phpfreaks.com/topic/255430-auto-update-of-table-value/ Share on other sites More sharing options...
AyKay47 Posted January 20, 2012 Share Posted January 20, 2012 you will want to use an UPDATE query, I have linked you to the documentation on the subject. http://dev.mysql.com/doc/refman/5.0/en/update.html Quote Link to comment https://forums.phpfreaks.com/topic/255430-auto-update-of-table-value/#findComment-1309594 Share on other sites More sharing options...
Psycho Posted January 20, 2012 Share Posted January 20, 2012 You shouldn't need to update anything. Instead you can set the date the record is created. Then when you query the database you can dynamically determine the status based upon the created date of the records and the current date. Quote Link to comment https://forums.phpfreaks.com/topic/255430-auto-update-of-table-value/#findComment-1309680 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.