CSCI 2006 - Spring 2024 - Server-Side ProgrammingLab #7 - DBMS SELECT

Lab #7 - DBMS SELECT

Purpose: Interact with a DBMS I

Instructions

  1. Keeping things simple, in regards to knowing what you are expecting, we will be implementing the programming language website again, but this time, with the data stored in a DBMS
  2. The host for accessing the database is localhost (because your script and the database are located on the same server)
  3. The username for accessing the databases used in this course is: csci2006
  4. The password for accessing the databases used in this course is: 9TfP4lxsxH1szKuA
  5. The database name is: csci2006_languages
  6. Copy either your solution, or the provided solution to lab #5 into a lab07 diectory in your webspace
  7. Modify the solution so that a database interaction is used instead of the calls to "getCSCI2006Data" function - this also means that you can remove the include/require statement for "csci2006data.php"
  8. You may use any of the database integration paradigms that were introduced in the slides for intergrating your site with the database, but your approach must still be relatively secure (i.e. you should not use queries that are built with user input, without having that input sanitized first)
  9. When reviewing how to use the results of the queries, I recommend doing a var_dump to see what the structure of the returned data is. After you have figured out the structure and how to use that in your code, you can remove the var_dump statement
  10. To get the list of languages from the database, please use
    SELECT `language_slug`, `language_name`
      FROM `language`
      ORDER BY `language_name`
  11. To get the data about a particular language (given the "slug" -- or url portion), use
    SELECT * 
      FROM `language`
      WHERE `language_slug`=?
    
  12. To get the description paragraphs for a particular language, use the "lang_id" value from the data about a particular language in this query:
    SELECT `desc_paragraph`
      FROM `description`
      WHERE `desc_lang`=?
      ORDER BY `desc_ordinal`
  13. Upload your PHP file(s) (if you have not been doing that to test your code as you go), to the remote server. Place the file in "public_html/csci2006/lab07/
  14. In a web-browser, go to the URL below

Submitting Instructions