Ver Mensaje Individual
  #4 (permalink)  
Antiguo 14/12/2009, 15:08
Avatar de claudiovega
claudiovega
 
Fecha de Ingreso: octubre-2003
Ubicación: Puerto Montt
Mensajes: 3.667
Antigüedad: 20 años, 6 meses
Puntos: 11
Respuesta: Ayuda con fechas por favor

A ver:

Código PHP:

    
//paso la fecha inicial a formato mysql, tomo la fecha la convierto a una array y luego en 3 variables, luego las concateno en formato año/mes/dia
     
list($dia,$mes,$ano)=explode("/",$_POST['AG_fechai']);
     
$fechai="$ano/$mes/$dia";

     list(
$dia,$mes,$ano)=explode("/",$_POST['AG_fechaf']);
     
$fechaf="$ano/$mes/$dia";

     
$updateSQL sprintf("UPDATE t_agenda SET AG_fechai=%s, AG_fechaf=%s, AG_precio=%s, AG_horario=%s, AG_titulo_esp=%s, AG_titulo_eng=%s, AG_titulo_ger=%s, AG_titulo_fra=%s WHERE id_AG=%s",
GetSQLValueString($fechai"date",
GetSQLValueString($fechaf"date",
GetSQLValueString($_POST['AG_precio'], "text",
GetSQLValueString($_POST['AG_horario'], "text",
GetSQLValueString($_POST['AG_titulo_esp'], "text",
GetSQLValueString($_POST['AG_titulo_eng'], "text",
GetSQLValueString($_POST['AG_titulo_ger'], "text",
GetSQLValueString($_POST['AG_titulo_fra'], "text",
GetSQLValueString($_POST['id_AG'], "int"); 
Puedes estudiarte las funciones que usé aqui:

http://cl.php.net/list
http://cl.php.net/explode