mm00re Posted June 23, 2009 Share Posted June 23, 2009 Where would be a good source for this kind of information as I have not really found anything specific to this that was somewhat easily explained. Link to comment https://forums.phpfreaks.com/topic/163431-solved-what-do-you-us-whenever-you-need-to-assign-a-modified-timedate-stamp-to-a-mysql/ Share on other sites More sharing options...
carlos1234 Posted June 23, 2009 Share Posted June 23, 2009 Not sure what you are asking. Can you rephrase the question? Carlos Link to comment https://forums.phpfreaks.com/topic/163431-solved-what-do-you-us-whenever-you-need-to-assign-a-modified-timedate-stamp-to-a-mysql/#findComment-862307 Share on other sites More sharing options...
ToonMariner Posted June 23, 2009 Share Posted June 23, 2009 I normally use a query to do that kind of thing. Link to comment https://forums.phpfreaks.com/topic/163431-solved-what-do-you-us-whenever-you-need-to-assign-a-modified-timedate-stamp-to-a-mysql/#findComment-862309 Share on other sites More sharing options...
mm00re Posted June 24, 2009 Author Share Posted June 24, 2009 well I thought it was simple but I have a record in my database that I want to reflect modification date and time, I have a field called LastMod, anytime I modify a record this field is updated along with the rest of the fields in the update script to show when something was modified. Link to comment https://forums.phpfreaks.com/topic/163431-solved-what-do-you-us-whenever-you-need-to-assign-a-modified-timedate-stamp-to-a-mysql/#findComment-862413 Share on other sites More sharing options...
carlos1234 Posted June 24, 2009 Share Posted June 24, 2009 Okay...well it sounds like you have what you need then... Link to comment https://forums.phpfreaks.com/topic/163431-solved-what-do-you-us-whenever-you-need-to-assign-a-modified-timedate-stamp-to-a-mysql/#findComment-862419 Share on other sites More sharing options...
mm00re Posted June 24, 2009 Author Share Posted June 24, 2009 not exactly I am trying to find out if there is a php function that will give a date and timestamp that I could pass to my "UPDATE" script Link to comment https://forums.phpfreaks.com/topic/163431-solved-what-do-you-us-whenever-you-need-to-assign-a-modified-timedate-stamp-to-a-mysql/#findComment-862439 Share on other sites More sharing options...
carlos1234 Posted June 24, 2009 Share Posted June 24, 2009 If you create a DATETIME file in a mysql table it is my understanding that this field is automatically updated whenever a change is made to the record that contains that field. So really, if that is the case...you do not need a PHP function to give you the proper date and time. Just create a field and make it of type DATETIME and then make a chance to the record and see if that field is updated automatically. Carlos Link to comment https://forums.phpfreaks.com/topic/163431-solved-what-do-you-us-whenever-you-need-to-assign-a-modified-timedate-stamp-to-a-mysql/#findComment-862442 Share on other sites More sharing options...
roopurt18 Posted June 24, 2009 Share Posted June 24, 2009 This type of logic is better left in the database and left out of PHP altogether. If you read the MySQL documentation on the DATETIME and TIMESTAMP data types you'll find the information you need. Link to comment https://forums.phpfreaks.com/topic/163431-solved-what-do-you-us-whenever-you-need-to-assign-a-modified-timedate-stamp-to-a-mysql/#findComment-862456 Share on other sites More sharing options...
ToonMariner Posted June 24, 2009 Share Posted June 24, 2009 hint: NOW() Link to comment https://forums.phpfreaks.com/topic/163431-solved-what-do-you-us-whenever-you-need-to-assign-a-modified-timedate-stamp-to-a-mysql/#findComment-862501 Share on other sites More sharing options...
mm00re Posted June 24, 2009 Author Share Posted June 24, 2009 ok thanks guys I'll check into it Link to comment https://forums.phpfreaks.com/topic/163431-solved-what-do-you-us-whenever-you-need-to-assign-a-modified-timedate-stamp-to-a-mysql/#findComment-862601 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.