I can't seem to figure out this parse error! When I run it, it returns an error that says: Parse error: parse error in /view_users.php on line 14
Here is my script:
<?php # - view_users.php
//This script retieves all the records for the users table.
ini_set('display_errors', 1);
error_reporting(E_ALL);
$page_title = 'View the Current Users';
include ('header.html');
//Page Header
echo '<h1 id="mainhead">Registered Users</h1>';
require_once ('Connections/dbc.php' //Connect to the db
//Make the query
$query = "SELECT CONCAT(last_name, ', ', first_name) AS name, DATE_FORMAT(registration_date, '%M %d, $Y') AS dr FROM test.users ORDER BY registration_date ASC";
$result = @mysql_query ($query); //Run the query
if ($result) { // If it ran OK, display the records
//Table header
echo '<table align="center" cellspacing="0" cellpadding="5">
<tr><td align="left"><b>Date Registered</b></td></tr>
';
//Fetch and print all the records
while ($row = mysql_fetch_array ($result, MYSQL_ASSOC)) {
echo '<tr><td align="left">' . $row['name'] . '</td><td align="left">' . $row['dr'] . '</td></tr>
';
}
echo '<table>';
mysql_free_result ($result); //Free up the resources
}else{ //If it did not run OK.
echo '<p class="error">The current users could not be retieved. We apologize for any inconvenience.</p>'; //Public message
echo '<p>' . mysql_error() . '<br><br>Query: ' . $query . '</p>'; // Debugging message
}
mysql_close(); //Close the database connection
include ('footer.html'); //Include the footer
?>
Thanks for your help.
Sonny