[SOLVED]Preventing TIMESTAMP from updating
Posted: Sat Oct 01, 2005 4:19 am
When you have rows that use a Timestamp, how do you stop it
from updating the date when the row is updated?
I know if using something like phpMyAdmin you just unselect the timestamp field,
but my question concerns when writing an update/edit script for a website-based admin.
The current update query I am using in my script is
Would something like
work to stop the timestamp from changing when being updated?
well, scratch that... doing it that way results in an empty timestamp.
hmm.. how to update and keep the timestamp the same as the original?
from updating the date when the row is updated?
I know if using something like phpMyAdmin you just unselect the timestamp field,
but my question concerns when writing an update/edit script for a website-based admin.
The current update query I am using in my script is
Code: Select all
$query="UPDATE news SET name='$ud_first', news='$ud_last' WHERE id='$ud_id'";Code: Select all
$query="UPDATE news SET name='$ud_first', news='$ud_last', date='' WHERE id='$ud_id'";well, scratch that... doing it that way results in an empty timestamp.
hmm.. how to update and keep the timestamp the same as the original?