What is wrong???

From: Date: Fri, 08 Mar 2002 03:55:05 +0000
Subject: What is wrong???
Groups: php.dev 
Request: Send a blank email to php-dev+get-80910@lists.php.net to get a copy of this message
My query has a bug that I can not detect.... My database called test has a table called projeto. This projeto table has the fields <id int,nome VARCHAR(40), setor VARCHAR(30), arquivo VARCHAR(120),status VARCHAR(2)> When I use the client mysql the query works fine. But when I put it in the php script below, an error appears exactly like "Query Error", that is telling me that my query is wrong. Where is the mistake?? <?php $qname = $HTTP_POST_VARS['ct_nome']; $qkey = $HTTP_POST_VARS['ct_kw']; $qdia = $HTTP_POST_VARS['ct_dia']; $qmes = $HTTP_POST_VARS['ct_mes']; $qano = $HTTP_POST_VARS['ct_ano']; $qautor = $HTTP_POST_VARS['ct_autor']; $qeng = $HTTP_POST_VARS['cS_eng']; $qdes = $HTTP_POST_VARS['cS_des']; $qFILE = "FILES"; $host = localhost; //Database Conection $link = mysql_connect($host,"root","root") or die("Not possible to connect"); print("Connection OK"); //Database Selection mysql_select_db("test") or die("Could not select database"); print("Selection OK"); $query = "INSERT INTO projeto (nome,setor,arquivo,status) VALUES ($qname,$qdes,$qFILE,'ok')"; print "$qname"; print "$qkey"; print "$qautor"; print "$qdia/$qmes/$qano"; //My Query mysql_query ($query) or Die ("Query Error"); echo "Projecto registered"; // Closing connection mysql_close($link); ?> Thanks you Daniel Castro

« previous php.dev (#80910) next »