Ver Mensaje Individual
  #3 (permalink)  
Antiguo 09/06/2007, 19:02
zeoneo
 
Fecha de Ingreso: mayo-2007
Mensajes: 41
Antigüedad: 17 años
Puntos: 0
Re: Crear registro de Fecha

ok,

como dige antes soy un poco lento para esto porque aun estoy aprendiendo.

Supongamos que el codigo es asi (esta generado por Dreamweaver):

Código PHP:
<?php
ob_start
();
function 
GetSQLValueString($theValue$theType$theDefinedValue ""$theNotDefinedValue ""
{
  
$theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $theValue;

  switch (
$theType) {
    case 
"text":
      
$theValue = ($theValue != "") ? "'" $theValue "'" "NULL";
      break;    
    case 
"long":
    case 
"int":
      
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case 
"double":
      
$theValue = ($theValue != "") ? "'" doubleval($theValue) . "'" "NULL";
      break;
    case 
"date":
      
$theValue = ($theValue != "") ? "'" $theValue "'" "NULL";
      break;
    case 
"defined":
      
$theValue = ($theValue != "") ? $theDefinedValue $theNotDefinedValue;
      break;
  }
  return 
$theValue;
}

$editFormAction $_SERVER['PHP_SELF'];
if (isset(
$_SERVER['QUERY_STRING'])) {
  
$editFormAction .= "?" htmlentities($_SERVER['QUERY_STRING']);
}

if ((isset(
$_POST["MM_insert"])) && ($_POST["MM_insert"] == "form3")) {
  
$insertSQL sprintf("INSERT INTO datos (rut, dverificador, nombre, email, direccion, comuna, ciudad, pais, carea, telefono) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s)",
                       
GetSQLValueString($_POST['rut'], "text"),
                       
GetSQLValueString($_POST['dverificador'], "text"),
                       
GetSQLValueString($_POST['nombre'], "text"),
                       
GetSQLValueString($_POST['email'], "text"),
                       
GetSQLValueString($_POST['direccion'], "text"),
                       
GetSQLValueString($_POST['comuna'], "text"),
                       
GetSQLValueString($_POST['ciudad'], "text"),
                       
GetSQLValueString($_POST['pais'], "text"),
                       
GetSQLValueString($_POST['carea'], "text"),
                       
GetSQLValueString($_POST['telefono'], "text"));

  
mysql_select_db($database_datos$datos);
  
$Result1 mysql_query($insertSQL$datos) or die(mysql_error());

  
$insertGoTo "datosok.php";
  if (isset(
$_SERVER['QUERY_STRING'])) {
    
$insertGoTo .= (strpos($insertGoTo'?')) ? "&" "?";
    
$insertGoTo .= $_SERVER['QUERY_STRING'];
  }
  
ob_clean();
  
header(sprintf("Location: %s"$insertGoTo));
  exit();
}

?>
Donde lo deveria incertar????

Debo crear un espacio en la table que almacene los datos de las fechas???


Gracias