Ver Mensaje Individual
  #1 (permalink)  
Antiguo 08/04/2008, 14:13
Avatar de hawaiian050
hawaiian050
 
Fecha de Ingreso: junio-2007
Mensajes: 285
Antigüedad: 19 años, 4 meses
Puntos: 2
Que tal , una pequeña consulta simple que no resulebo al mostrar una funcion date

Hola, me muestra la fecha pero no la guardada en la mysql , una de ejemplo supongo .

Código PHP:
$Sql = "SELECT * FROM tabla ORDER BY id DESC";
$Query = mysql_query($Sql);
$Records = mysql_num_rows($Query);
$Results = 20;
$Current = intval($_GET["p"]);
$Current = !$Current ? 1 : $Current;
$OffSet = ($Current * $Results) - $Results;

$Sql.= " LIMIT $OffSet,$Results";
$Query = mysql_query($Sql) or die(mysql_error());
while(
$Data = mysql_fetch_assoc($Query)){

  
$fecha = date("d/m/Y",$Data["fecha"]); //nos muestra la fecha

echo $fecha;
  
  
// 4/08/2008 4082008 

Me ayudarian por favor ? podrian decirme si estoy haciendo algo errado ?

SQL

Código PHP:
CREATE TABLE `tabla` (
  `
id` int(11) NOT NULL auto_increment,
  `
fecha` int(10) NOT NULL default '0',
  
PRIMARY KEY  (`id`)
) 
ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; 
Me la muestra de esta forma en la MYSQL ejemp: , 4082008,


Desde ya muchas gracias , un Sauldo

Última edición por hawaiian050; 08/04/2008 a las 14:18