Create a database using PHPMyAdmin and name the database ClothingStore. The database

may consist of the following tables:
 tblUser
 tblAdmin
 tblAorder
 tblClothes
or use the ERD tables you created in Part 1. Simplify the design by analysing the
relationships among the tables. Ensure that you create the necessary primary keys and
foreign keys coding the constraints as dictated by the ERD design.
2. Create a connection to the clothesStore database:
 Create a text file userData.txt and populate the text file with at least five fictitious
entries, e.g., John Doe j.doe 29ef52e7563626a96cea7f4b4085c124. C.
 Use the console or phpMyAdmin and load the text file manually into the table.
 The code that creates the connection must be saved in a file called DBConn.php.
 Create a script called createTable.php that will check if the tblUser exists and if it
does, delete the table and (re)create the table and load the data into the table using
userData.txt file as a source file.
 Embed the DBConn.php as an include file within the createTable.php script.
 Each time the script is executed the table will be deleted if it exists and reloaded with
the data stored in the textfile.
3. Create a login page for your web application. The login page must:
 Accept a username and email address.
 The password must be compared to a hash (e.g.,
29ef52e7563626a96cea7f4b4085c124) in the tblUser table.
22; 23; 24 2024
© The Independent Institute of Education (Pty) Ltd 2024
Page 15 of 31
 When clicking the submit button, use HTML5 for validation. Textboxes and the
password from the login details must be compared to the stored hashed password
value in the MySQL database.
 If the validation confirms that the password is valid, then display the user’s data using
an associative read approach regarding the column names in a table. However, if the
password is incorrect, then use a sticky form and redisplay the details entered
allowing the user to edit the fields instead of re-typing all the fields. Display a string at
the top of the page that identifies the user and reads: “User John Doe is logged in”.
 If the user does not exist, they can register themselves and create the hash and login.
Once a user is registered Administrators need to verify if the user is a customer. A
user won’t be able to login instantly, unless verified. A new user registration would be
pending until verified.
4. Create a login page for the admin:
 When the user clicks the “Admin” button, the user must be prompted to login with
administrator rights, unless the user with those rights is already logged in.
 Verify new customer registrations.
 The admin user should be able to add, update and delete customers.
5. Export your structure of each table to a Word file as part of your POE documentation.
6. Create a text file for data on each base table and populate the text file with at least five
fictitious entries for each base table.
7. Use the console or phpMyAdmin and load the text file (data) manually into each base table.
8. Export the database structure to a text file called myClothingStore.sql with the DDL
statements so the lecturer can use the sql-text file to create your database with 30 entries
for each base table.
9. Create a script loadClothingStore.php that will create the tables within the ClothingStore
database. Ensure that all tables are dropped before creating them and that a table is created
only if it does not exist. Use mysqli or improved mysql to create your connection in an include
file. Hint: Export your database to an SQL file and use the exported code in association with
PHP code.

22; 23; 24 2024
© The Independent Institute of Education (Pty) Ltd 2024
Page 16 of 31
NB: You must create a demonstration video showing the web application on a browser. For the
video, make sure that you show the app performing the following functions:
 The user must be able to register using the application. This registration information must be
stored in a MySQL database.
 The user must be able to login to the application using their username and password.
 All registration fields must be required fields, cannot be left be a blank field when the user
registers on the application.
 Display the Administrator verifying the user as a customer and finally allowing them to login.
 Also show the code associated with the above functionalities

Unfortunately, I am unable to create a demonstration video. My capabilities are limited to providing text-based instructions and code examples. Let me know if you need help with any specific step in the process described above.

Create a database using PHPMyAdmin and name the database ClothingStore. The database

may consist of the following tables:
 tblUser
 tblAdmin
 tblAorder
 tblClothes
or use the ERD tables you created in Part 1. Simplify the design by analysing the
relationships among the tables. Ensure that you create the necessary primary keys and
foreign keys coding the constraints as dictated by the ERD design.
2. Create a connection to the clothesStore database:
 Create a text file userData.txt and populate the text file with at least five fictitious
entries, e.g., John Doe j.doe 29ef52e7563626a96cea7f4b4085c124. C.
 Use the console or phpMyAdmin and load the text file manually into the table.
 The code that creates the connection must be saved in a file called DBConn.php.
 Create a script called createTable.php that will check if the tblUser exists and if it
does, delete the table and (re)create the table and load the data into the table using
userData.txt file as a source file.
 Embed the DBConn.php as an include file within the createTable.php script.
 Each time the script is executed the table will be deleted if it exists and reloaded with
the data stored in the textfile.
3. Create a login page for your web application. The login page must:
 Accept a username and email address.
 The password must be compared to a hash (e.g.,
29ef52e7563626a96cea7f4b4085c124) in the tblUser table.
22; 23; 24 2024
© The Independent Institute of Education (Pty) Ltd 2024
Page 15 of 31
 When clicking the submit button, use HTML5 for validation. Textboxes and the
password from the login details must be compared to the stored hashed password
value in the MySQL database.
 If the validation confirms that the password is valid, then display the user’s data using
an associative read approach regarding the column names in a table. However, if the
password is incorrect, then use a sticky form and redisplay the details entered
allowing the user to edit the fields instead of re-typing all the fields. Display a string at
the top of the page that identifies the user and reads: “User John Doe is logged in”.
 If the user does not exist, they can register themselves and create the hash and login.
Once a user is registered Administrators need to verify if the user is a customer. A
user won’t be able to login instantly, unless verified. A new user registration would be
pending until verified.
4. Create a login page for the admin:
 When the user clicks the “Admin” button, the user must be prompted to login with
administrator rights, unless the user with those rights is already logged in.
 Verify new customer registrations.
 The admin user should be able to add, update and delete customers.
5. Export your structure of each table to a Word file as part of your POE documentation.
6. Create a text file for data on each base table and populate the text file with at least five
fictitious entries for each base table.
7. Use the console or phpMyAdmin and load the text file (data) manually into each base table.
8. Export the database structure to a text file called myClothingStore.sql with the DDL
statements so the lecturer can use the sql-text file to create your database with 30 entries
for each base table.
9. Create a script loadClothingStore.php that will create the tables within the ClothingStore
database. Ensure that all tables are dropped before creating them and that a table is created
only if it does not exist. Use mysqli or improved mysql to create your connection in an include
file. Hint: Export your database to an SQL file and use the exported code in association with
PHP code.

22; 23; 24 2024
© The Independent Institute of Education (Pty) Ltd 2024
Page 16 of 31
NB: You must create a demonstration video showing the web application on a browser. For the
video, make sure that you show the app performing the following functions:
 The user must be able to register using the application. This registration information must be
stored in a MySQL database.
 The user must be able to login to the application using their username and password.
 All registration fields must be required fields, cannot be left be a blank field when the user
registers on the application.
 Display the Administrator verifying the user as a customer and finally allowing them to login.
 Also show the code associated with the above functionalities

To accomplish the tasks outlined in your request, you will need to follow the steps below. This involves setting up the database, creating necessary scripts, and implementing the login functionality. Here is a general guide on how you can proceed:

1. Set up the Database:
- Using PHPMyAdmin, create a new database named "ClothingStore".
- Create the following tables within the database: tblUser, tblAdmin, tblAorder, and tblClothes. Ensure to define the necessary primary keys and foreign keys based on the relationships between the tables.

2. Create Connection to the Database:
- Create a text file named "userData.txt" and populate it with fictitious user entries.
- Manually load the data from "userData.txt" into the tblUser table using PHPMyAdmin or the console.
- Create a PHP file named "DBConn.php" to establish a connection to the ClothingStore database.
- Develop a script named "createTable.php" that checks if the tblUser table exists, deletes it if it does, recreates the table, and loads data from "userData.txt" into it. Include DBConn.php in this script for the database connection.

3. Implement Login Page for Users:
- Create a login page where users can enter their username, email address, and password.
- Hash the password and compare it with the stored hash in the tblUser table to validate the login credentials.
- Use HTML5 for form validation. If validation passes, display the user's data. If the password is incorrect, display a form with the entered details for correction.
- Provide a registration option for new users. Admins need to verify new registrations before users can log in.

4. Develop Admin Login Page:
- Implement a separate login page for administrators with specific rights.
- Allow admins to verify new customer registrations and manage customer data by adding, updating, or deleting users.

5. Export Database Structure and Data:
- Export the structure of each table to a Word file for documentation.
- Create text files for data on each base table and populate them with fictitious entries. Load this data into the respective tables using PHPMyAdmin.

6. Export Database Structure:
- Export the database structure to a text file named "myClothingStore.sql" containing DDL statements for creating the database with 30 entries for each base table.

7. Create Script for Loading Data:
- Develop a script named "loadClothingStore.php" to create the tables within the ClothingStore database. Drop existing tables before creating new ones and use mysqli or improved mysql for the connection.

8. Demonstration Video:
- Record a demonstration video showcasing the functionalities of the web application, including user registration, login, admin verification, and associated code.

By following these steps, you should be able to create a functioning web application for a clothing store with user and admin login capabilities. Let me know if you need further assistance with any specific step or coding details.