You are here: Problem with insert « PHP Programming Language « IT news, forums, messages
Problem with insert

Posted by zek2005 on 02/11/07 13:53

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_date)";
$result=mysql_db_query($database,$query,$link);
if(mysql_affected_rows($link))
{
echo "OK";
}
else
{
echo "Nothing inserted";
}

Thanks for your help

Ezequiel

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация