Jump to content

[SOLVED] quick echo DATE question


Gem

Recommended Posts

hmmmmm ... excuse my ignorance...

<?php 
mysql_select_db("bssql", $con);
$result = mysql_query("SELECT `event`, `date` FROM `diary` ORDER BY date DESC LIMIT 5") or die(mysql_error());
while($row = mysql_fetch_assoc($result))
{
    ?><b><a href="diary.php"><?php echo $row['event'];?></a></b> 
    <BR><?php echo $row['date']?><BR><BR><?php
}
mysql_close($con);
?>

 

Where would I put that??? ... ??? ;D

i would try something like this...

<?php 
mysql_select_db("bssql", $con);
$result = mysql_query("SELECT `event`, `date` FROM `diary` ORDER BY date DESC LIMIT 5") or die(mysql_error());
while($row = mysql_fetch_assoc($result))
{
    $date = explode("-",$row['date']);
    $date = date("jS F Y",mktime(0,0,0,$date[1],$date[2],$date[0]));
    echo '<b><a href="diary.php">'.$row['event'].'</a></b> 
    <br />'.$date.'<br /><br />';
}
mysql_close($con);
?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.