Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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.


Task 1: Make sure student_db is loaded

  1. 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.
  2. 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

  1. 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.
  1. 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.
  2. 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
  1. 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.


image text in transcribed

Student Schedules LAST NAME baggins fold kelly melt melt skywalker winchester FIRST NAME bilbo bill charlie patty patty luke sam PHONE NUMBER (531)646-3828 (402)531-6222 (402)234-6859 (402)234-9876 (402)234-9876 (402)543-1234 (402)234-2346 COURSE NUMBER ring1001-1r info2630-ww info1620-la info2630-ww info1325-4c info2430-2b psych1666-ww COURSE NAME how to leave the shire & live forever intro. to sql intro. to databases intro. to sql software engineering I internet scripting jedi mastery living with the demon inside LOCATION soc mahoney 214 online sarpy 214 online soc mahoney 205 soc mahoney 205 online MEETING TIMES f 10-11:45 am m/w 1-2:45 pm t/h 10-11:45 am m/w 10-11:45 am EARNED GRADE A

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Income Tax Fundamentals 2013

Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill

31st Edition

1111972516, 978-1285586618, 1285586611, 978-1285613109, 978-1111972516

More Books

Students also viewed these Databases questions