This week we're continuing PHP for Beginners Part 3, which is working with databases in PHP, along with a bonus lesson on YAML. YAML (YAML Ain't Markup Language), is a human-readable data serialization format that's been widely adopted in a variety of use cases in Drupal 8. Anyone wanting to write modules, or themes, for Drupal 8 will need to understand YAML syntax. Even site-builders are likely to encounter YAML at least in passing as YAML is the data-serialization format of choice for Drupal 8's configuration management system. Joe created a short tutorial to look at the YAML data format and provide examples of how to write and read YAML, so that you're ready for it when Drupal 8 comes out.
Last week, we started off my covering the fundamentals of SQL and working with a MySQL database. Today we hook this up with the PHP site we're building. You're going to learn how to connect the database to PHP, and understand your basic working tool, PDO objects. With that in place we'll take a look at setting up database configuration files in PHP and how to play around with our data by limiting our results.
This week's PHP lessons are:
- Connecting to MySQL in PHP
- Database PDO Class and Object
- Database Configuration Files in PHP
- Limit Database Results
Next week we'll be finishing up Part 3 with a tour PHP functions and an important lesson on security when working with databases.