Ver Mensaje Individual
  #9 (permalink)  
Antiguo 22/08/2012, 13:11
dannysoft
 
Fecha de Ingreso: julio-2008
Mensajes: 39
Antigüedad: 15 años, 9 meses
Puntos: 1
Respuesta: codigo php actualizar

listo ya le coloque el ; que faltaba al final:

Código PHP:
<?php 
include('_conec.php'); 
$b1=$_POST['paterno']; 
$b2=$_POST['materno']; 
$b3=$_POST['nombre']; 
$b4=$_POST['direccion']; 
$b5=$_POST['telefono']; 
$b6=$_POST['nacimiento']; 
$codigo=$_GET['id']; 
//$sql="UPDATE datos set alupat='$b1',alumat='$b2', 
//alunom='$b3',aludir='$b4',alutel='$b5',alunac='$b6' 
//where alucod=$codigo"; 
echo $sql="UPDATE datos set (alupat,alumat,alunom,aludir,alutel,alunac) 
values('$b1','$b2','$b3','$b4','$b5','$b6')"

//where alucod=$codigo"; 
$exito=mysql_query($sql); 
echo 
mysql_error(); 
if (
$exito==1){ 
header('location: resultados.php'); 
}else{ 
echo 
"Error al actualizar <br>$sql"

?>
y me salio esto:

UPDATE datos set alupat='sasasas',alumat='MARTINEZ', alunom='DANIEL',aludir='[email protected]',alutel=' 9666-4458',alunac='2000-04-03' where alucod=\"1\"You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '\"1\"' at line 3Error al actualizar
UPDATE datos set alupat='sasasas',alumat='MARTINEZ, alunom='DANIEL',aludir='[email protected]',alutel=' 9666-4458',alunac='2000-04-03' where alucod=\"1\"

que significa ese error ¿?