Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL UPDATE command

Status
Not open for further replies.

philclare

Programmer
Jul 31, 2003
34
GB
I have a table in my mySQL database consisting of a number of fields including two date fields.

In a page I perform an update changing the value of one field, however the update also changes the value of the first date field to NOW() (i.e. today's date). It doesn't however update the second date. The only way I can get it to stop it is to update the date field setting it to itself (e.g.)
UPDATE tblBookings SET status='B' AND BookingDate = BookingDate WHERE BookingID='1'

I'm pretty sure I have checked everything I can think of, there seems to be no difference between the date fields and there is no default set up on either field. Also, (although I don't know if this is significant) if I go to the table in phpmyadmin and try to update the row the value in the listbox for that field is automatically set to NOW() but not for the second date field.

I hope that makes sense

Phil Clare
 
sorry, just noticed that they are timestamps and the first one is automatically updated...

sorry to waste time, thanks for the response sleipnir I guess that is where you were going!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top