This is a private message system. It should be inserting data into the table, but it is not at all.. Thanks for the help.
Sql 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 ‘from, body, subject, date_sent VALUES(‘itunes89′,’itunes89′,’sd’,’s’,’9-05-2012 ‘ at line 1
$sql = "INSERT INTO pm_inbox (to_user, from, body,subject,date_sent)VALUES('$userIdFromPost','$user','$body','$sub','$date')";
mysql_query($sql);
echo "Error: " . mysql_error($con);
echo "<br/>Inserted: '$userIdFromPost','$user','$body','$sub','$date'";
You missed a
)after your column list. Please refrain from usingmysql_functions. Use prepared statements with eithermysqliorPDOlike so:Further,
fromis a reserved name in MySQL. It needs to be encased like so: