Hi,

On Wed, Apr 02, 2003 at 05:01:48PM -0300, Sibusy wrote:
> I'm trying to perform UPDATE with a PHP form , but the UPDATE query doesn't work 
> anyway, returning"Can't perform the update", according to code below. It doesn't 
> return any error at PHP nor at Mysql, I have tested the variables and they are 
> beeing sent properly.Could someone help me???
> Here goes the code : <?php 
>     $db=mysql_connect("$host","$user","$senha") or die("Erro de Conexăo");
> 
>     mysql_select_db($dbnome,$db);
> 
>     $sql="UPDATE [LOW PRIORITY] grupoadministracao WHERE idgrupo = '$nid' SET nome = 
> '$nome', resp= '$resp',      
>              cnpj='$cnpj', cpf='$cpf', ie='$ie', 
> endereco='$endereco',numero='$numero',cpto='$cpto', cep='$cep',  
>              
> telefone1='$telefone1',telefone2='$telefone2',fax='$fax',celular='$celular',email='$email',login='$login',senha='$senha'";
>  
> 

The WHERE should be at the end of the query.

Also use addslashes() to properly escape quotes in your variables.


>     $result=mysql_query($sql,$db);    
>    
>              if($result) {
>                      echo ("Data<b>$nome</b>, registro nș<b>$nid</b> was 
> successfully updated.<br>");
>                      } else {
>                             echo "Can't perform the update. ";
>           mysql_error();

Try this:

echo mysql_error()


>          }    
> 


Regards,

Fred.

-- 
Fred van Engen                              XB Networks B.V.
email: [EMAIL PROTECTED]                Televisieweg 2
tel: +31 36 5462400                         1322 AC  Almere
fax: +31 36 5462424                         The Netherlands

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to