Recap from class (week 4)

This week, you’re writing your first database app from scratch.

It’s not totally from scratch, though — you have the Sock Market GitHub repo for all the JavaScript and PHP code. You’ve successfully transferred your Shoutbox project from your own laptop to your hosted website, so you know how to do that. Refer to the docs from that assignment.

One new thing is how to export and import your MySQL database. You’ll do this using phpMyAdmin. Instructions are here: Import or Export a Database Table. It’s surprisingly easy.

In Assignment 1 (bottom of page 1), database privileges (permissions) were mentioned. When you’re setting up a new database on your hosted server, it’s good to think carefully about the minimum privileges that the users of this database will need. Refer to that section of Assignment 1 when you set up your new database for Assignment 2. Privileges are also covered in the “Make your SQL safer” section of the Khan Academy SQL course.

The document that explains all the PHP mysqli_ commands: Sockmarket: MySQL and PHP. These are the details about prepared statements, which prevent SQL injection attacks. This is also the document that explains the while loop (see page 8) that you’ll use to get the data from your MySQL table into an HTML table (or other HTML) on a normal web page.

The document that explains the interconnection of all the files in the Sockmarket GitHub repo: Using the Sock Market files. This is like a flowchart showing how the files talk to one another, and in which order.

The last slide deck about SQL (based on Khan Academy) covers UPDATE and DELETE, as well as database transactions. You will not be using transactions in your new database.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s