I have a problem with an insert. The connection to DB works fine and I
receive an OK when the PHP process but nothing is inserted in the DB.
I added an echo of mysql_affected_ rows and the result is -1. That's
why I get an OK?
$query="INSERT INTO preguntas (pregunta, id_usuario, fecha) VALUES
('$pregunta','$ id',current_dat e)";
$result=mysql_d b_query($databa se,$query,$link );
if(mysql_affect ed_rows($link))
{
echo "OK";
}
else
{
echo "Nothing inserted";
}
Thanks for your help
Ezequiel
receive an OK when the PHP process but nothing is inserted in the DB.
I added an echo of mysql_affected_ rows and the result is -1. That's
why I get an OK?
$query="INSERT INTO preguntas (pregunta, id_usuario, fecha) VALUES
('$pregunta','$ id',current_dat e)";
$result=mysql_d b_query($databa se,$query,$link );
if(mysql_affect ed_rows($link))
{
echo "OK";
}
else
{
echo "Nothing inserted";
}
Thanks for your help
Ezequiel
Comment