Related to php and mysql applications

Source: Internet
Author: User
; $ 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 '
   
   ';// Fetch and print all the records:while ($row = mysqli_fetch_array($r, MYSQLI_ASSOC)) { echo ' 
     ';}echo ' 
    
Name Date Registered
' . $row['name'] . ' ' . $row['dr'] . '
'; // 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;

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.