DEFAULT CURRENT_TIMESTAMP - means that any INSERT without an explicit t
ime stamp setting uses the current time. UPDATE CURRENT_TIMESTAMP means that any update without an explicit timestamp res ults in an update to the current timestamp value. On my part, I created the database in PhpMyAdmin in accordance with WAMP or XAMP P. I have set the given values namely ID, username, password, firstname and lastnam e. On the ID value, i have set the AUTO_INCREMENT which means it allows a unique nu mber to be generated when a new record is inserted into the table. On the code, the ID row serves an auto increment primary key field. Means that the ID is a primary key. The created_on means that on what date and time a new record is inserted into th e table. While the updated_on means that on what and time a record is being changed or re vised. The database collation "utf_8_general_ci means is the assembly of data informati on into a standard order and concerned with the ordering of items of information . -------------------------------------------------------------------------------- ------------------------------------------- 3. The config.php file consists of set variables I have made for the username an d password for the XAMPP or WAMP together with the hostname and the database nam e which is elective_one. The purpose of this file is to transfer the user credentials of the database whi ch is commonly seen on one file only including the form and etc. This is to avoid confusion and easy calling the user credentials of the database . after that, I have created a new file named db_connect.php which serves a connec tion to the database. it would refer and need the user credentials set on config .php. On this file, we require the config.php in order to verify the set variables wi th its corresponding credentials of the database. The PDO we have set the mysql:host, dbname , the username and the password as a referal to the config.php file. then we have set the the following: THE PDO:ATTR_ERRMODE - is an attribute that refers to the PDO error. Mostly it h as 3 types of error under it but we used the ERRMODE_EXCEPTION - it will throw an EXCEPTION when an error occurs in the datab ase. -------------------------------------------------------------------------------- ------------------------------------------- 4. a. On our form, it has the capability of adding ,editing and deleting a speci fic user. Although the ID value is an auto incremented primary key in the databa se, it serves as the basis of the database when editing or deleting a certain us er. In order the password data to be hashed before saving it into the database, the md5 hashing method is used. An MD5 hash is NOT encryption. It is simply a fingerprint of the given input. It is used by taking a string of an any length and encoding it into a 128-bit fing erprint. The purpose is to ensure the password data to be safe when it is saved in the da tabase. -------------------------------------------------------------------------------- ------------------------------------------- b. EDIT - When a certain entry has been saved onto the database, it has the capability t o edit the data that has been inputted. - It can edit the username, firstname and lastname only. The password cannot be changed because it has been hashed onto the database. - On the code, when editing it refers to the auto-incremented primary key ID in the database which has been -------------------------------------------------------------------------------- ------------------------------------------ c. DELETE - As the same rule of deleting a record, it has the warning of you will continue of deleting a certain record or not. - When deleting, it also refers to the ID in the database where iit gets the val ue. - We have set the buttons "yes and no" -> if YES it would get the value of the I D and other information and delete it. - IF NO, it would redirect the page only.