Ver Mensaje Individual
  #4 (permalink)  
Antiguo 30/05/2011, 08:33
Saneko
 
Fecha de Ingreso: marzo-2011
Mensajes: 107
Antigüedad: 13 años, 1 mes
Puntos: 22
Respuesta: No consigo guardar la fecha

Es mysql, pero da igual. A mi me funciona, te paso el código para que lo toques a tu manera.

Código PHP:
<?php
if(!$_POST)
{
?>
    <form name="prueba" method="post" action="">
    <input type="text" name="fecha" value="<?php $hoy date('Y-m-d H.i:s'); echo $hoy?>">
    <input type="submit" value="ya">
    </form>
<?php
}
else
{
    
$hoy $_POST['fecha'];
    
    echo 
$hoy '<br>';
    
    
$db mysql_connect('192.168.1.23','USRTIENDAPHP','PWDTIENDAPHP!');
    
mysql_select_db('DB_TIENDADISENOSWEB',$db);
    
    
$query "INSERT INTO tablefecha (fecha) VALUES ('" $hoy "')";
    
    
mysql_query($query,$db);
}
?>