Ver Mensaje Individual
  #4 (permalink)  
Antiguo 16/04/2005, 11:49
Avatar de Gabriel0702
Gabriel0702
 
Fecha de Ingreso: febrero-2005
Mensajes: 155
Antigüedad: 19 años, 1 mes
Puntos: 0
Registro de fecha

Yo lo hago así, lo puedes adecuar a tu código como tú quieras, me imagino que lo único que te interesa del código es la parte de la fecha, por eso no incluyo lo que hace la función GetSQLValueString, pero si alguno está interesado, me puede pedir el código completo.

Código PHP:
$Fecha=getdate();
  
$_POST['FecIngTxt']=$Fecha["year"]."/".$Fecha["mon"]."/".$Fecha["mday"];
  
$insertSQL sprintf("INSERT INTO usuarios (NomUser, ApePat, ApeMat, Matr, Id_SecU, Jerar, email, password, FecIng) VALUES (%s, %s, %s, %s, %s, %s, %s, old_password(%s), %s)",
                       
GetSQLValueString($_POST['UserName'], "text"),
                       
GetSQLValueString($_POST['ApePatTxt'], "text"),
                       
GetSQLValueString($_POST['ApeMatTxt'], "text"),
                       
GetSQLValueString($_POST['MatriculaTxt'], "text"),
                       
GetSQLValueString($_POST['SeccionList'], "text"),
                       
GetSQLValueString($JerarUsuarioExt"text"),
                       
GetSQLValueString($_POST['email'], "text"),
                       
GetSQLValueString($_POST['Contra'], "text"),
                       
GetSQLValueString($_POST['FecIngTxt'], "date"));

  
mysql_select_db($database_connBDBV$connBDBV);
  
$Result1 mysql_query($insertSQL$connBDBV) or die(mysql_error()); 

$_POST['FecIngTxt'] es un campo oculto que pongo en el formulario, y capturo la fecha antes de insertar el registro.