; $ R @ mysqli_query ($ dbc, $ q); Runtheq mysqlphp
// This script retrieves all the records from the users table.
$ Page_title = 'View the Current users ';
Include ('Des/header.html ');
// Page header:
Echo'
Registered Users ';
Require ('./mysqli_connect.php'); // Connect to the db.
// Make the query:
$ Q = "select concat (last_name, ',', first_name) AS name, DATE_FORMAT (registration_data, '% M % d, % Y ') AS dr FROM users order by registration_data ASC ";
$ R = @ mysqli_query ($ dbc, $ q); // Run the query.
If ($ r) {// If it ran OK, display the records.
// Table header.echo '
| Name |
Date Registered |
';// Fetch and print all the records:while ($row = mysqli_fetch_array($r, MYSQLI_ASSOC)) { echo '
| ' . $row['name'] . ' |
' . $row['dr'] . ' |
';}echo '
'; // Close the table.mysqli_free_result ($r); // Free up the resources.
} Else {// If it did not run OK.
// Public message:echo 'The current users could not be retrieved. We apologize for any inconvenience.
';// Debugging message:echo '' . mysqli_error($dbc) . '
Query: ' . $q . '
';
} // End of if ($ r) IF.
Mysqli_close ($ dbc); // Close the database connection.
Include ('shortdes/footer.html ');
?>
Larry Ullman (php and MySQL) has been tuned for two hours. I didn't understand it. I couldn't connect to the database. the omnipotent CSDN can help me;
View the Current Users
Your Website
Catchy slogan...
- Home Page
- Register
- View Users
- Change Password
- Link five
Registered Users
The above HTML is the result of running the file, and all database-related code in php is omitted;