having problems inserting data into the mysql db.
the values from the form are actually being inserted into the bd but the test statement after that is showing the following:
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 ‘1’ at line 1
here’s the php code
[php]<?php
include("…/…/lib/conectar.inc");
if(isset($_POST[‘submit’])){
$grava=mysql_query(“INSERT INTO filmes (id,nome,ano,elenco,comentario) VALUES (’’,’$_POST[nome]’,’$_POST[ano]’,’$_POST[elenco]’,’$_POST[comentario]’)”,$conn);
if(!(mysql_query($grava,$conn))){
die("Error: ".mysql_error());
}else{
echo("$_POST[nome] inserido com sucesso.");
}
mysql_close($conn);
}
?>[/php]
here’s the html form
[code]
Name:
Year:
Cast:
Comment:
any help would be appreciated.
thanks