Chapter 9: Using PHP with MySQL

No. Descriptions Show
1. To register: Register1(script 9.3)
2. To View Users View Users 1(script 9.4)
3. To register(modified): Instead of $fn = trim($_POST['first_name']); use $fn = mysqli_real_escape_string($dbc, trim($_POST['first_name'])); mysqli_close($dbc); // Close the database connection. The mysqli_real_escape_string( ) function escapes a string in accordance with the language being used (i.e., the collation).The trim( ) function is still used to get rid of any unnecessary spaces If you don’t use stripslashes( ) and Magic Quotes is enabled, the form values will be doubly escaped. Register2(script 9.5)
4. To View Users with total number of users by using $num = mysqli_num_rows($r); View Users(script 9.6)
5. To Change Password: use the mysqli_error( ) function if mysqli_affected_rows( ) returns the number 1, the record has been updated Password(script 9.7)

Review

No. Questions Answers
1 What version of PHP are you using? What version of MySQL? Does your PHP-MySQL combination support the MySQL Improved extension?
2
3
4
5
6
7
8
9
10