Jump to content

prevent time from updating


rbragg

Recommended Posts

This question will probably sound really stupid:

 

I am storing the date and time of an insertion into the db using now(). However, if I update any other fields/columns in the db later - that date/time is also updated. How can I prevent this?

 

Thanks in advance!

Link to comment
Share on other sites

I'm not dabbling with the time at all:

 

<?php
$queryUpdate = " 
UPDATE vigil_call
SET status = '$status'
WHERE callID = '$callID'
";
$update = mysql_query($queryUpdate);
?>

 

I imagine my problem is that the column need not be the timestamp type?

 

Link to comment
Share on other sites

I imagine my problem is that the column need not be the timestamp type?

 

Sounds like the column is type TIMESTAMP, the purpose of which is to auto-update when the record is changed.

 

We were right. :) Changing the type gave the result I needed. Thanks everyone for your help.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.