Unexpected T_STRING
Posted: Tue Jul 18, 2006 1:34 am
I have the following code and I don't know why it is happening:
Parse error: parse error, unexpected T_STRING in /home/blu6592/public_html/diary2/modify_entry.php on line 4
Here is my code that I am working with:
Parse error: parse error, unexpected T_STRING in /home/blu6592/public_html/diary2/modify_entry.php on line 4
Here is my code that I am working with:
Code: Select all
require "config.php";
$query = 'UPDATE diary_contents SET diary_entry = '$_POST['diary_entry']'';
if (mysql_query ($query)) {
print '<p>The diary entry has been modified. <a href=view.php>Click here</a> to continue.</p>';
} else {
print "<p>Could not add the entry because: <b>" . mysql_error() .
"</b>. The query was $query.</p>";
}
mysql_close();