Posts: 2,536
Location: Western Maryland
|
One thing I am seeing right off hand is that you are checking $_POST[submit], but then building your query from $_POST[contents]. Why not check isset($_POST[contents]) as well to make sure you're not trying to submit a null or empty string. Similarly, you are not checking $_POST[id] either though it is used.
One thing I always do when I run into a SQL query: Print out the contents of your SQL string then plug it into the query window in phpMyAdmin or similar tool. You will get a much more robust error message.
Also, you are specifically assigning $contents to $_POST[contents], but then continue to use $_POST[contents]. It is not an error, but why are you doing that?
__________________
—Kyrnt
|