Your project must meet the following specifications:
1. Create a table tbl_User in MySQL using the console or phpMyAdmin, consisting of the following column names:
a. The table structure is as follows for tbl_User:
ID (autoincrement - PK), FName (text), LName (text), Email (text), Password (Text);
b. Create a text file userData.txt and populate the textfile with at least 30 fictitious entries, e.g. John Doe firstname.lastname@example.org 29ef52e7563626a96cea7f4b4085c124;
c. Use the console or phpMyAdmin and load the text file manually into the table.
I have managed to complete this question.
This question below is what I'm struggling with....
2. Use the existing test database that is pre-installed with wamp or xamp.
a. Create a connection within the test database using PHP and store the code which creates a connection in a file called DBConn.php.
b. Create a script called createTable.php that will check if the table tbl_User exists and if it does, delete the table and (re)create the table and load the data into the table using the userData.txt file as source file.
c. Embed the DBConn.php as an include file within the createTable.php script. Hint: You may include the connection code in the createTable.php directly and later refactor the code into an include file to modularize your code.
d. Each time the script is run the table will be deleted if it exists and reloaded afresh with the data stored in the text file.