table column value gets updated automatically
Posted: Tue Aug 03, 2004 7:24 am
Hello I have the following table definition:
I set the expiration using the following query:
I can check the database and I see that the expiration value has been changed, by calling:
Later in the code I call the following query:
After this query runs, I see that the Param values gets changed to 'aaa', BUT the Expiration column gets changed too -> to the current timestamp!, and the previous value has been lost!
Is this how things are suppose to happen?
I thought that the Expiration column shouldn't change.
thanks
Code: Select all
CREATE TABLE session_info (
SessionID INT UNSIGNED NOT NULL AUTO_INCREMENT,
Param VARCHAR(255) NOT NULL,
Expiration TIMESTAMP NOT NULL,
PRIMARY KEY (SessionID)
) ENGINE=MYISAM DEFAULT CHARSET=latin1;Code: Select all
$expiration = time() + 7200;
UPDATE session_info SET Expiration = FROM_UNIXTIME($expiration) WHERE SessionID = 5;Code: Select all
select UNIX_TIMESTAMP(Expiration) Expiration from session_info where SessionID = 5;Code: Select all
UPDATE session_info SET Param= 'aaa' WHERE SessionID = 5;Is this how things are suppose to happen?
I thought that the Expiration column shouldn't change.
thanks