Troubleshoot MySQL query

Posted by Victor on Stack Overflow See other posts from Stack Overflow or by Victor
Published on 2010-06-09T02:11:27Z Indexed on 2010/06/09 2:12 UTC
Read the original article Hit count: 300

Filed under:
|

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.

© Stack Overflow or respective owner

Related posts about php

Related posts about mysql