# \[MySQL\] Updating entries

**URL:** <https://forum.kirupa.com/t/mysql-updating-entries/192226>\
**Category:** programming\
**Created:** [June 27, 2006, 4:42am UTC](https://forum.kirupa.com/t/mysql-updating-entries/192226 "2006-06-27T04:42:44Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![NeoDreamer](https://avatars.discourse-cdn.com/v4/letter/n/ccd318/32.png) [@NeoDreamer](https://forum.kirupa.com/u/NeoDreamer)\
**Post date:** [June 27, 2006, 4:42am UTC](https://forum.kirupa.com/t/mysql-updating-entries/192226/1 "2006-06-27T04:42:44Z")

</div>

I’m making a mini forum. Entries are saved in the “blog” table. The first post of a thread will contain extra info that the response posts don’t, such as the last comment time and author, # comments, and # views. My problem is that whenever I make a response post, the time stamp of the first post gets changed to the time the response post was made. Check out the code and the screenshot of the table.

```auto

// make new response post
$sql3 = "select * from members where ID=$viewerID";
$rs3 = mysql_query($sql3, $conn) or die ("Could not connect. <a href=\"$link\">Try again</a>.");
$row3 = mysql_fetch_array($rs3);
$lastAuthor = $row3["username"];
$sql3 = "insert into blog (startAuthor, message, thread, views) values (\"$lastAuthor\", \"$response\", \"$threadID\", -1)";
$result3 = @mysql_query($sql3, $conn) or die("Could not post thread. <a href=\"$link\">Try again.</a>");
			
// update first post's info
$sql3 = "update blog set comments = comments + 1 where ID = $threadID";
$result = @mysql_query($sql3, $conn) or die("Could not post thread. <a href=\"$link\">Try again.</a>");
$sql3 = "update blog set lastAuthor = \"$lastAuthor\" where ID = $threadID";
$result3 = @mysql_query($sql3, $conn) or die("Could not post thread. <a href=\"$link\">Try again.</a>");
$lastTime	= date("YmdHis");
$sql3 = "update blog set lastTime = \"$lastTime\" where ID = $threadID";
$result3 = @mysql_query($sql3, $conn) or die("Could not post thread. <a href=\"$link\">Try again.</a>");

```
