Before this week, data for our programs has been stored using either objects in our code or in session data in our browser. The memory space this information has inhabited in our computer is called random-access memory, or RAM. RAM is a fast, temporary place to store information, but is not suitable for long-term storage. We also learned how to store data with Silex using the superGlobal variable, $_SESSION. Both of these are great solutions for storing information you don't need to keep around indefinitely. As you undoubtedly experienced for the past two weeks, if you shut down your server and re-launch your application, most of your program's data is gone!
Anything we want to have saved after our programs end and our machines have been powered off needs to be written to permanent storage. Beginning this week, we will begin saving data in full-blown databases!
We'll begin by learning about SQL, or Structured Query Language, and how to use it with PostgresSQL through MAMP. Then, we'll cover how to setup and configure our very own databases, including best practices for naming and data organization/architecture. After that, we'll explore connecting databases to our PHP applications, so our data can persist indefinitely.
By the end of the week you'll be able to:
This week's independent project will be reviewed on the following criteria: