Timestamp field

From: Date: Mon, 05 Feb 2001 23:33:40 +0000
Subject: Timestamp field
Groups: php.general 
Request: Send a blank email to php-general+get-38336@lists.php.net to get a copy of this message
I'm currenly having a problem with a timestamp field I have on my message board...each message is given a timestamp and stored in a table...heres the basic form of the insert... $time_added=date("Y m d H i s A"); $str = "INSERT INTO topic ( num_id, user, quote, subject, ip, message_icon, page, post_id, thread_page, forum_num, time_added) VALUES (\"$comment_id\", \"$user[0]\", \"$quote\", \"$subject\", \"$ip\", \"$message_icon\", 0, \"$new_post_id[0]\", \"$thread_page_num\", \"$f\", \"$time_added\")"; $result = mysql_query($str); $time_added is a timestamp field in my MySQL table this works fine... But in the adminstrative tools im setting up, if i edit the post and resubmit the time is updated to the current time. Heres the admin code i use to update the post...t, transaction, is the unique field for each post so I use it to pull up the post..the body of the post is in a textarea (name=editpost) and i change it as needed and submit it which directs the script to the following block of code: $editpost = addslashes($editpost); $insertion = "update topic set quote=\"$editpost\" where transaction=\"$t\""; $insertion_query = mysql_query($insertion); The post is updated fine but the time is changed as I stated...Now I know I could pull the time_added field out and assign it to a separate variable and re-insert it when im updating but I'm curious as to why this would be happening...These are the only places where any modifications are made to the posts...on insertion and admin modification so I'm stumped as to what could be happening. Any ideas or suggestion, Regards, Chad Guilette

« previous php.general (#38336) next »