Multi layer architecture SQL ACID properties Atomic -- The transaction runs completely or not at all Consistent -- Each transaction moves from one consistent state to another Independent -- Every transaction runs as if it were the only one on the system Durable -- Data changes survive hardware and software failure. Abort Table vs database create table schema not null primary key types decimal(5,2) date and time types enum blob/longblob update tablename set columnname = value where ... delete from tablename where ... select columnname from tablename where .. order by columname limit 3 (not in 2020)alter table ... drop tablename describe table tablename joins nested queries (and in vs =) min and max count and average and group by insert into tablename values ( ...) (not in 2022)database decomposition might cost speed reduces redundency and possibility of inconsistency Indexes PHP Built in arrays $_GET $_POST $_COOKIE $_SESSION $_REQUEST Error supression with @ isset($varname) empty($varname) Error checking with die Arrays Not really arrays indexed by key, which can be string not always the same type foreach ($array as $item) foreach($array as %key => $item) Cookies Uses session cookies vs cookies with an expire time limits on size limits on domain/hostname Can be turned off $_COOKIE Session variables $_SESSION Needs cookies No reasonable size limits Expires when the session does Allows for privacy Requires cookies Loops while loops for loops foreach($array as $value) foreach($array as $index => $value) Functions default arguments function foo($name = "Default Name") (not much in 2022) Objects __construct __tostring $this->thing $this->method() vs method() class vs local vs global variables print_r header("location: ...") Variables global superglobal $_REQUEST $_COOKIE $_POST $_GET Databases Know some way to fetch data like http://euclid.nmu.edu/~rappleto/Classes/CS465/PHP/Databases/Database_Example_Object.php.txt real_escape_string Error checking Files (not in 2022) Open a file Read a file Write a file See if the file exists File Uploads See https://www.php.net/manual/en/features.file-upload.post-method.php Login To login: Get username/pwd if you like it Server sends random number to client To verify you are logged in: client sends chosen number back to server with request (like an input field or cookie) Remember... passwords always hashed in the DB Remember, Session variables work better than this because they are this.