You probably need to wrap the strings you are trying to input with quotation
marks.

Try modifying this line  (add \") :
   $query = "INSERT INTO projeto (nome,setor,arquivo,status) VALUES
 (\"$qname\",\"$qdes\",\"$qFILE\",'ok')";

Robert Zwink
http://www.zwink.net/daid.php


-----Original Message-----
From: Daniel F. Castro [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 08, 2002 8:29 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Query bug, what is wrong?


<?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(mysql_error());
   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 (mysql_error());
   echo "Projecto registered";

   // Closing connection
   mysql_close($link);
 ?>

 Thanks you

 Daniel Castro




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to