Databases




CS174

Chris Pollett

Oct 3, 2016

Outline

Database Management Systems and Databases

Last Day, we learned about the MVA design pattern. Models in this pattern often interact with a database so today we are going to have a whirlwind tour of databases to learn how to do this.

MySQL Databases

MySQL Command Line

MySQL Command Line

Quiz

Which of the following statements is true?

  1. In the model view adapter design pattern, models are responsible for interacting with persistent storage such as the file system or a database.
  2. When a form is sent using get only the hidden variables in it are appended to the url after a '?', the rest are sent as part of the request message body.
  3. Any variable declared using the global keyword is a PHP superglobal.

Quiz

Which of the following statements is true?

  1. When a form is posted, all hidden variables in it are appended to the url after a '?'.
  2. Part of the the implementation of sessions in PHP makes use of the cookie protocol.
  3. To declare a variable as being of scope local to just the current function in PHP one uses the local keyword.

Basic SQL

Database, Table Creation Deletion

SQL Query

SQL Insert, Delete, Update

Connecting to a database from PHP

Connecting to a database from PHP

Selecting a Database and queries

Accessing More Advanced Features of Mysql

Other Database Interfaces in PHP

Some Quick Remarks on Database Design

Example