I have the following code pulling dates and times out of a database set by now() and would like to format them to look nice.
Also I would like to display these results in two columns in an HTML table.
<?php
$db = "register";
$link = mysql_connect( "localhost:/users/rupertbj/domains/rupstar.co.uk/sql/mysql.sock", "root" );
if ( !$link ) die( "Couldn't connect to MySQL" );
mysql_select_db( $db, $link ) or die( "Couldn't open $db: ".mysql_error() );
$sql = "SELECT * FROM userTable ORDER BY date_time DESC";
$result = mysql_query( $sql, $link );
mysql_close( $link );
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
<html>
<head>
<meta name="keywords" content="rupert, bowen-jones, rupert bowen-jones, homepage, room, friend, photo, book, read, chat, message, italy, slovakia">
<meta name="description" content="">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="format.css" type="text/css">
<title>List users on rupstar.co.uk</title>
</head>
<body bgcolor="#8080FF">
<p align=center><img src="/images/rupstar.gif"></p>
<table width="100%" cellpadding=5>
<tr width="33%">
<td bgcolor="#FF9922" width="20%" valign=top><a href="admin.php"><< BACK</a>
<td bgcolor="#003399" valign=top align="center" class="subtitle">List users
<table width="90%" cellspacing="10" cellpadding="3" align="center">
<tr>
<td valign="top" bgcolor="#FF0000" class="text">User - Last logged on:</td>
</tr>
<tr>
<td valign="top" bgcolor="#FF0000" class="text">
<?php
while ( $newArray = mysql_fetch_array($result) )
{
$email = $newArray['email'];
$date_time = $newArray['date_time'];
print "$email - $date_time<br>";
}
?>
</td>
</tr>
</table>
</td>
</tr>
</table>
<p class=mini>Designed by <a href="mailto:design@rupstar.co.uk"><b>rupstar</b></a><b>
© 2002</b></p>
</body>
</html>
Thank you in advance for your assistance.