Ver Mensaje Individual
  #3 (permalink)  
Antiguo 28/06/2012, 14:50
matt_1985
 
Fecha de Ingreso: enero-2011
Ubicación: /root
Mensajes: 530
Antigüedad: 13 años, 3 meses
Puntos: 61
Respuesta: function para actualizar datos

Quedaría algo como esto ,

Código PHP:
Ver original
  1. <?php
  2.     /**/
  3.         error_reporting(E_ALL ^ E_NOTICE);
  4.     /**/
  5.  
  6.     session_start();
  7.  
  8.     require_once('conexion.php');
  9.    
  10.     $accion = (isset($_POST['accion']) ? $_POST['accion']:(isset($_GET['accion']) ? $_GET['accion']:""));
  11.  
  12.     switch($_POST['accion']) {
  13.         case "actualizarcuenta" :
  14.                     Actualizar_Cuenta($link);
  15.                     break;
  16.     }
  17.    
  18.    
  19.     function Actualizar_Cuenta($link){
  20.        
  21.         $update_cuenta = sprintf("UPDATE tb_usuarios SET nombres = %s
  22.                                   WHERE id_usuario = %s",
  23.                                   GetSQLValueString($_SESSION['id_usuario'], "int"),
  24.                                   GetSQLValueString($_POST['nombres'], "text"),);
  25.                          mysql_query($update_cuenta, $link) or die(mysql_error());                       
  26.                          header ("Location: ../micuenta.php");
  27.                          
  28.         return $update_cuenta;
  29.     }  
  30. ?>

La probe pero nose en que sigo fallando .

Saludos

Última edición por matt_1985; 28/06/2012 a las 15:04