Beispiel #1
0
 public function registrarUsuario(UsuarioDto $usuarioDto, $cnn)
 {
     //$cnn = Conexion::getConexion();
     $mensaje = "";
     try {
         $query = $cnn->prepare("INSERT INTO usuarios VALUES(?,?,?,?,?,?,?)");
         $query->bindParam(1, $usuarioDto->getDocumento());
         $query->bindParam(2, $usuarioDto->getNombre());
         $query->bindParam(3, $usuarioDto->getApellido());
         $query->bindParam(4, $usuarioDto->getTelefono());
         $query->bindParam(5, $usuarioDto->getUsuario());
         $query->bindParam(6, $usuarioDto->getContraseña());
         $query->bindParam(7, $usuarioDto->getTipo());
         $query->execute();
         $mensaje = "Registrado";
     } catch (Exception $ex) {
         $mensaje = $ex->getMessage();
     }
     $cnn = null;
     return $mensaje;
 }