Ver Mensaje Individual
  #1 (permalink)  
Antiguo 27/07/2009, 11:39
jorgegetafe
 
Fecha de Ingreso: febrero-2008
Ubicación: Madrid
Mensajes: 474
Antigüedad: 16 años, 3 meses
Puntos: 1
Exclamación Error sintaxis update

Tengo un error de sintaxis en el siguiente código, por más que miro no lo encuentro, me esta volviendo loco:

Código PHP:
$consulta=" update contacto set nombre ='".$_POST['nombre']."',
                                        apellido1='"
.$_POST['apellido1']."',
                                        apellido2='"
.$_POST['apellido2']."',
                                        sobrenombre='"
.$_POST['sobrenombre']."',
                                        fechaNacimiento="
."'".$_POST['anio']."-".$_POST['mes']."-".$_POST['dia']."',
                                        sexo='"
.$_POST['sexo']."',
                                        direccion='"
.$_POST['direccion']."',
                                        mapaDireccion='"
.$_POST['mapaDireccion']."',
                                           ciudad='"
.$_POST['ciudad']."',
                                        provincia='"
.$_POST['provincia']."',
                                        pais='"
.$_POST['pais']."',
                                        codigoPostal='"
.$_POST['codigoPostal']."',
                                        paginaWeb='"
.$_POST['paginaWeb']."',
                                        telefono='"
.$_POST['telefono']."',
                                        fax='"
.$_POST['fax']."',
                                        movil='"
.$_POST['movil']."',
                                        correo='"
.$_POST['correo']."',
                                        telefonoTrabajo='"
.$_POST['telefonoTrabajo']."',
                                        faxTrabajo='"
.$_POST['faxTrabajo']."',
                                        movilTrabajo='"
.$_POST['movilTrabajo']."',
                                        direccionTrabajo='"
.$_POST['direccionTrabajo']."',
                                        telefono='"
.$_POST['telefono']."',
                                        empresa='"
.$_POST['empresa']."',
                                        mapaTrabajo='"
.$_POST['mapaTrabajo']."',
                                        correoTrabajo='"
.$_POST['correoTrabajo']."',
                                        contactoDe='"
.$_POST['contactoDe']."',
                                        comentario='"
.$_POST['comentario']."',
                                        contactoDe='"
.$_POST['contactoDe']."',
                                        tipoContacto='"
.$_POST['tipoContacto']."',
                                        where numeroContacto = '"
$_POST['numeroContacto']."';";                            
                                echo 
$consulta;            
        
$resultado=mysql_query($consulta);
        return 
$resultado;
    } 
Mysql dice lo siguiente: #1064 - 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 'where numeroContacto = '5'' at line 1

Muchas gracias.