Hi there
I'm fairly new to PHP and MySQL, and ahve found it great so far. However I'm totally stuck on this problem. I keep receiving the error message: "could not update article; Incorrect key file for table: 'tcms_articles'. try to repair it" When executing the following code:
case 'Save Changes':
if (isset($POST['title'])
and isset($POST['body'])
and isset($POST['article'])
and isset($POST['subject'])
and isset($POST['description'])
and isset($POST['identifier']))
{
$sql = "UPDATE cms_articles " .
"SET title='" . $POST['title'] ."', body='" . $POST['body'] . "', subject='" . $POST['subject'] . "', description='" . $POST['description'] . "',identifier='" . $POST['identifier'] . "',date_submitted='" . date("Y-m-d H:i:s",time()) . "' " .
"WHERE article_id=" . $POST['article'];
if (isset($POST['authorid'])) {
$sql .= " AND author_id=" . $POST['authorid'];
}
I've looked up this error message, and it's the result of a corrupt table. However I've repaired the table, then run the above, and got the same error. I've tried completely dropping the database, and recreating. All the other code I'm using on this DB runs fine, but the above update query seems to corrupt the table every time, even when I've set up a brand new table. So it must be the code corrupting the table...which is where I'm stuck.....PLEASE HELP! WHAT IN THE ABOVE CODE IS CAUSING THE CORRUPTION EVERY TIME, REGRADLESS OF IT BEING NEW TABLE ETC???