Content Revised 3/29/14 Authors Grant Tepper
Girl Develop It is here to provide affordable and accessible programs to learn software through mentorship and hands-on instruction.
Some "rules"
PHP was invented in 1994 by Rasmus Lerdorf originally named after Personal HomePage tools, in 1995 Rasmus released the code to the public and the rest is history... More Here
PHP is a turing complete language, which means anything a program can potentially do, PHP can do.
Objects are an Object Oriented programing concept (that was redundant). Objects represent data that describes components or things in a system. Objects have properties(variables) which describe them, and methods(functions) which allow the objects to preform actions.
Classes are the templates from which a developer can 'spawn' or instanciate new instances of their class; thus creating objects. Think of them like blueprints.
Relational databases are a standardized way to store data, there are many standards, relational data being one of the more popular and earliest to emerge.
Initially we will be using PHP MyAdmin to create and manage our database structure. As you get more advnaced you may be interested in learning how to do this all from the command line.
Time to explore PHP My Admin!
A schema is a fancy word for the structure of your database
To connect to a database you need at least 3 things
We will be using PDO, a PHP 'binding' for MySQL which will do most of the heavy lifting for us
DataBase Abstraction Layer (DBAL) is a term used to describe a tool that serves as an interface to a database. For our purposes PDO is this tool, exposed to us as a standard library.
This is the primary way to add new data
We are going to be importing a CSV (comma seperated variable) file into our database, then reading it into a table on a webpage!
UPDATE tableName SET colname = val1, colname2 = val2 WHERE conditonal
This is where the bulk of a databases power comes in. We can create queries to give us data in almost any manner we'd like.
SELECT * FROM tableName WHERE conditional ORDER BY column_name, column_name ASC|DESC WHERE can use things like AND , and, OR to make more complex conditionals, SQL also has a series of functions you can leverage, like SUM and AVG, or time functions like NOW Lets experiment with some queries against our records!Deleting things is permant!!! Normally in SQL databases things are never deleted, just 'soft deleted' or flagged so they are not returned in result sets
This is where SQL is very defferent from other database, and along side its powerful Queries, another distinguishing feature.
SELECT * FROM table1 JOIN table2 ON table1.column_name=table2.column_name
The objective is to build the back end for an admin panel which manages a blog.
This is probably where most of the time will be spent, the controller contains most of our logic