I have never run across this problem before in 2 years of PHP/MySQL. Maybe it's been happening all along and I just didn't realize it.
I have a table that holds articles that are posted on a site. The table is designed as so:
+--------------------+---------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+--------------------+---------------+------+-----+---------+----------------+
| ID | int(11) | | PRI | NULL | auto_increment |
| articleDate | timestamp(14) | YES | | NULL | |
| articlePostedBy | varchar(50) | | | | |
| articleTitle | text | | | | |
| articleAuthor | varchar(255) | | | | |
| articleSource | varchar(255) | | | | |
| articleDescription | text | | | | |
| articleBody | text | | | | |
+--------------------+---------------+------+-----+---------+----------------+
The problem I am having is that for some reason, the "articleDate" field updates every time I edit an article. In the past, it's never been this way. I tried changing the definition to allow NULL, but it didn't work. The SQL I am using to update the table is this:
$SQL = "UPDATE $objAdmin->dbTable
SET articleTitle='$articleTitle',
articlePostedBy='$_SESSION[userID]',
articleAuthor='$articleAuthor',
articleSource='$articleSource',
articleDescription='$articleDescription',
articleBody='$articleBody'
WHERE ID = '$ID'";
Everything updates just fine, but I don't want the articleDate field to update as well. Any ideas (if this made any sense)?