Ver Mensaje Individual
  #5 (permalink)  
Antiguo 16/10/2014, 23:05
saikoru
 
Fecha de Ingreso: octubre-2014
Ubicación: Oaxaca
Mensajes: 11
Antigüedad: 9 años, 6 meses
Puntos: 0
Respuesta: Error al ejecutar consulta en base de datos

Mil disculpas amigo, y te agradezco tu tiempo en apoyarme.

este es el codigo:

Código PHP:
Ver original
  1. <?php
  2.     require_once("../scripts/verificar.php");
  3.     _header("..::Actualizar Empleado::..",menuUs(),$nombre);
  4.    
  5.     if(!empty($_POST)){
  6.         $post = slashes($_POST);
  7.         $nom = $post["nombre"];
  8.         $apellidos = $post["apellidos"];
  9.         $dire = $post["direccion"];
  10.         $rfc = $post["rfc"];
  11.         //$estado = $post["estado"];
  12.         $telefono = $post["telefono"];
  13.  
  14.         $sql = "update trabajador set nombre='$nom',apellidos='$apellidos',rfc='$rfc',direccion='$dire',telefono='$telefono' where idT = '$datos->idT'";
  15.         if(consulta($sql)){
  16.             echo msj(array("La actualizacion se realizo con exito"),"ok");
  17.         }
  18.         else
  19.             echo msj(array("Error al ejecutar la consulta"));
  20.         echo "<br />";
  21.         echo href("modDatos.php#");
  22.     }      
  23.  
  24. ?>
  25. <div class='form' style='width: 500px;'>
  26.             <h1>Actualizar mis datos</h1>
  27.             <form id='form1' name='form1' method='post' action='modDatos.php'>
  28.                 <ul>
  29.                 <li><label>Nombre:</label><input name='nombre' type='text' class='validate[required,custom[onlyLetterSp]]' id='nombre' size="50" value="<?php echo $datos->nombre;?>"></li>
  30.                 <li><label>Apellidos:</label><input name='apellidos' type='text'  class='validate[required,custom[onlyLetterSp]]' id='apellidos' size="50" value="<?php echo $datos->apellidos;?>"></li>
  31.                  <li><label>Dirección:</label><input value="<?php echo $datos->direccion;?>" type='text' class='' name='direccion' id='direccion'></li>
  32.                  <li><label>Telefono:</label><input type='text' class='' value="<?php echo $datos->telefono;?>" name='telefono'  id='telefono'></li>
  33.                  <li><label>R.F.C:</label><input type='text' class='' name='rfc'  id='rfc' value="<?php echo $datos->rfc;?>"></li>
  34.                  
  35.               <li><input type='submit' value="Guardar" name='b1' id='b1'></li>
  36.                 </ul>
  37.             </form>
  38.         </div><br />
  39. <?php
  40.     _footer();
  41. ?>