Thanks for the help and support - However, as those errors were cleared up, everything worked, but now I am trying to put an edit feature in my simple CMS, but I am hitting a lot of walls: Firstly, I have to escape EVERY apostrophe and other special character otherwise I get a MySQL error, and now no matter what I do in the code, I get this error:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Div_Class' = 'tpost', 'Title' = '2011-07-06', 'Date' = 'Hello World - Post 1', at line 1
Basically, this is how it's supposed to work:
Function gets current data ----------> The User can Edit that data, ----------> A simple PHP file puts it
from MySQL, and puts it in then submits it through a function that inserts
the input boxes. the new data into MySQL
But this hasn't worked. Here is the code: (I won't include HTML and the form)
//From cms_functions.php
function editPost($Div_Class, $Title, $Date, $Author, $Content, $id) {
$id = (int) $id;
$query = mysql_query("UPDATE posts SET 'Div_Class' = '$Div_Class', 'Title' = '$Title', 'Date' = '$Date', 'Author' = '$Author', 'Content' = '$Content' WHERE ID ='$id'") or die(mysql_error());
header("Location: posts.php");
}
--------------------------------------------------------
//From edit.php
<tr>
<td class="descriptor"><label for="Div_Class">Class: (tpost / ipost / cpost)</label></td>
<td><input type="text" name="Div_Class" class="inputother" value="<?php echo $post['Div_Class']; ?>" /></td>
</tr>