Assignment 9
Integrate dynamic content into a AwardSpace
website using PHP5 and the MySQL database.
Required Knowledge & Skills
- account on AwardSpace
- setting up a MySQL database
- creating and populating tables in MySQL
- HTML tables
- basic PHP5 scripting
Part 1 (40 points)
- Watch this short tutorial on how to configure a MySQL database on AwardSpace.
- Create a MySQL database. You may use any password, but be sure to write it down so you can connect to the database later. (10 points)
- Create one table called "products" in your database and add the columns (attributes) "p_name" for product name as VARCHAR with length 64, "p_desc" for product description VARCHAR with length 2048, and "p_img" for a URL to the product image VARCHAR with length 1024. (10 points)
- Designate the "p_name" column as your table's primary key by clicking on the Primary Key link in the field description; this ensures that all products are unique and there are no duplicates. (10 points)
- Add at least 3 rows in the table with meaningful values. (10 points)
Part 2 (60 points)
- Create a custom dynamic page in PHP5 on AwardSpace that displays the information in the database in the layout below.
- Note: The reference below is for boats. You may choose to have any product depending on the theme of your website.
- Connect to the table you created using PHP. Verify that the connection was successful and use "die" to print an appropriate error if it fails. (10 points)
- Populate the product data in HTML using a loop in PHP. (20 points)
- Use a Bootstrap grid with 2 columns to achieve the layout below. (10 points)
- Use different Bootstrap classes for styling (10 points)
- All pages in your nav bar must be linked to each other. (10 points)
- Indent your code correctly (HTML/CSS/JS/PHP) (10 points penalty)
Hints
- Save your script before you run it or you will lose your work.
- Test a small piece of code, make sure it works before you add more to your code.
- Get the HTML to work first in an interactive editor (like w3school editor), then place the PHP code around it.
- Note that the text in the reference below has a reduced size of 10pt (or 10px) and a custom RGB color (#788287). You may choose your own styling.
- For images, you may choose to provide links to any external website (recommended). Alternatively, you may upload the image to Awardspace and then provide a link to that image.
- Make sure there a semi-colon at the end of each statement, except when there's a { after.
- Be sure to close all strings.
- To put a string within a string use single quote, e.g., echo "<img src='" . $row["b_img"] . " '> ";
Submission - Upload any pages created/modified to AwardSpace. Add all your files (HTML/CSS/media files, etc.) to a folder and compress it. Submit your zipped file along with the URL of the web page of your Assignment 9 on AwardSpace to Canvas. The URL should be submitted as a submission comment with your zip file. Please test all the links within your website before submission.
Grading Rubric as specified in instructions | Submission Instructions