Task 1:Make sure student_db is loaded If you successfully completed last week's assignment 8, you should have
Fantastic news! We've Found the answer you've been seeking!
Question:
Task 1: Make sure student_db is loaded
- If you successfully completed last week's assignment 8, you should have a database named student_db loaded on your VM. If you do not, or you altered the structure of that database (added/deleted tables or columns or deleted multiple records), please load a fresh version of the database using the create script found with assignment 8.
- Notice that in the create script, a user is created. That user, named webuser, will the user you connect to the database with for this assignment.
Task 2: Download and update the starter code
- Attached to this assignment in our online class is a zip file of starter code. Download this starter code and unzip it to your local git repository workspace.
- Note! For testing, you will want to place the contents of this folder into your htdocs directory of your XAMPP installation - just as we have done with previous exercises and book examples. You can choose to house your Git repo there as well or to have a dev directory elsewhere and move things over into the XAMPP directories as appropriate for testing.
- Most of the folders and files present in this starter code are files included to style our page. There are many freely available css/html templates that can be used in a similar fashion. Our job will be to update the db.php and index.php files.
- Start by completing the db.php file. This should include the following:
- Setting a value for $dsn
- Setting a value for $username
- Setting a value for $password (you will need to reference the create script to gather this password)
- Creating a new PDO connection stored to a variable within a try
- Storing an error message to a variable within a catch
- Next, complete the index.php file. This should include the following:
- Setting a value for $qry that will provide all the necessary fields to create the table in figure 1.
- Setting a value for $stmt that will prepare the query.
- Executing the statement.
- Fetching the full result set of the statement and storing that set in a variable.
- Closing the connection.
- Creating table header entries for each of the column heading cells shown in figure 1, using the template provided.
- Using PHP to loop through the result set stored previously, creating a row and
entries for all required information shown in figure 1.
Related Book ForIncome Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date: