Skip to content

Lab - Week 13

Book Exercises

Complete the following exercises in chapter 26:

  • Chapter 26:
    • 1: Rewrite Bad Libs using Object-Oriented Programming
      • 1: Create a class called BadLibs and save it in a PHP script called BadLibs.php
      • 2: Create properties for holding a noun, verb, adjective, adverb, and story
      • 3: Create getters and setters for ALL your properties
      • 4: Create a method for inserting the new properties into your mad libs database table
      • 5: Create a method for querying the stories that returns a result set sorted newest to oldest
      • 6: Create a method that takes the results set (from the query) as an argument and returns the results in a formatted HTML table
      • 7: Create another PHP script that uses your BadLibs class. It should be a self referencing form and conform to the Project1 requirements
      • 8: You may use your existing Bad Libs database or create a new one

Lab Testing Requirements

  • Include screenshots of forms with entered data and screenshots of output to webpage

Lab Submission

  • Complete all of your labs in your labs/week13 folder
  • Dump your database (either using the MySQL CLI or Adminer) and save it to your labs/week13 folder
  • Test all of your code and include your screenshots in a folder called: labs/week13/screenshots
  • Compress your labs/week13 folder with your completed labs and dumped database and submit it to Blackboard