views:

57

answers:

4
$sql=mysql_query("INSERT INTO admin_cont 
                  (contact_idemail , contact_timestamp , contact_objet , contact_message) 
                 VALUES 
                  ('".$_COOKIE['zzzzz']."', '$timestamp', '$objet', '$message' ") or die(mysql_error()); 

i keep getting the 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 '' at line 1

cheers

+4  A: 

Close ) for VALUES.

Soufiane Hassou
yes yes my bad, you know the kind of simple stuff i sometimes dont see, thanks everybody!
tada
A: 

Try this.

$sql=mysql_query("INSERT INTO admin_cont (contact_idemail , contact_timestamp , contact_objet , contact_message) VALUES ('".$_COOKIE['zzzzz']."', '$timestamp', '$objet', '$message')");

As stated in the other answers, you need to close the mysql_query statement. Now you are using

or die(mysql_error()

as part of the query string.

Neb
+1  A: 

You need to add a close parenthesis after '$message'

TheJacobTaylor
A: 

Once you fit your immediate error, you'll want to fix the fact that your query is tremendously insecure. You need to use parameterized queries or run your values through mysql_real_escape_string().

ceejayoz