<?php
require_once ('mysql_connect.php'); // Connect to db
// Make the query
$query = "SELECT CONCAT(lastname, ', ', firstname) AS name, DATE_FORMAT (createdate, '%d %M, %Y') AS dr FROM users ORDER BY createdate ASC";
$result = @mysql_query ($query); // Run the query
if ($result) { // If it ran OK, display the records.
echo '<table alighn="center" cellspacing="2" cellpadding="2">
<tr><td align="left"><b>Name</b></td><td align="left"><b>Date Registered </b></td></tr>
';
// Fetch and print all the records.
while ($row = mysql_fetch_array($result, MYSQL_NUM)) {
echo "<tr><td align=\"left\">
$row[0]</td><td align=\"left\">
$row[1]</td></tr>\n";
}
echo '</table>';
mysql_free_result ($result); // Free up resources
} else { // If it did not run OK.
echo '<p>System error. We apologise for any inconvenience.</p><p>' .
mysql_error() . '</p>';
}
mysql_close(); // Close the database connection
?>.