php-db | 2002091
Date: 09/11/02
- Next message: bbonkosk <email protected>: "Re: [PHP-DB] MySQL timestamp field update problem"
- Previous message: Rob Day: "[PHP-DB] MySQL timestamp field update problem"
- In reply to: Rob Day: "[PHP-DB] MySQL timestamp field update problem"
- Next in thread: bbonkosk <email protected>: "Re: [PHP-DB] MySQL timestamp field update problem"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
At 11:59 -0500 9/11/02, Rob Day wrote:
>Hi all,
>I have a table in MySQL with the following field:
> 'time_date' timestamp(14) NOT NULL
>When a record is inserted into the table, NULL is inserted into the
>time_date field giving me a normal timestamp with the time of the INSERT.
>That much is fine.
>However, it is necessary for me to update some of the records in my table.
>But whenever I send an UPDATE, the timestamp changes.
That is how TIMESTAMP is documented to work.
> I would like for the
>timestamp value to remain unchanged. Is there a way to do this without
>reading the old value of the timestamp and reinserting with my UPDATE query?
You don't need to read it, just set the column to itself:
UPDATE tbl_name SET ts_col = ts_col, your_other_col = some_value, ...
>Thanks.
>-Rob
>
>--
>PHP Database Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
-- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
- Next message: bbonkosk <email protected>: "Re: [PHP-DB] MySQL timestamp field update problem"
- Previous message: Rob Day: "[PHP-DB] MySQL timestamp field update problem"
- In reply to: Rob Day: "[PHP-DB] MySQL timestamp field update problem"
- Next in thread: bbonkosk <email protected>: "Re: [PHP-DB] MySQL timestamp field update problem"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

