I need help with this code, it doesent insert the values to my database. Probably a simple problem but it's late here in Sweden so I would appriciate if someone could have a look at this and tell me what's wrong:
include "../../inc/mysql_config.php";
$to = mysql_real_escape_string($_POST['to']);
$message = mysql_real_escape_string($_POST['message']);
mysql_query("INSERT INTO messages (to, message) VALUES ('".$to."', '".$message."')");
Every variable have an value, double checked that and the mysql_config.php is working.
MySQL error code:
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 'to, message) VALUES ('hubb', 'asd')' at line 1