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 char[n] vs varchar[n] money autoincrement update tablename set columnname = value where ... delete from tablename where ... select columnname from tablename where .. order by columname limit 3 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 ( ...) database decomposition might cost speed reduces redundency and possibility of inconsistency Indexes What is an SQL injection attack (i.e. little bobby tables)!!!! Should media files be in the database 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 Objects __construct Does not call the superclass's constructor. parent::__construct __destruct() Does not call the superclass's destructor parent::__destruct() __tostring $this->thing $this->method() vs method() class vs local vs global variables print_r header("location: ...") Variables global superglobal $_REQUEST $_COOKIE $_POST $_GET $_SERVER Databases Know some way to fetch data like mysqli_query mysqli_num_rows mysqli_fetch_row mysqli_connect mysqli_select_db real_escape_string Error checking Files fopen and fread and fclose file and maybe implode works on URLS and files and such. What if your file is named “http://www.server.com”??? Regular Expressions end of line chars ^ and $ Repeat chars * and + Maybe char ? Sets of chars [abc] and [^abc] Ranges of chars [a-z] Special sets like /s and /S modifiers like “/steve/i” Regular Expression PHP Methods preg_match and preg_match_all preg_replace preg_split Login Pick random number Verify random number passwords always encrypted! Know this is vulnurable to snoop attack Cookies Uses Size limit what to do if turned off Can they be trusted? When can you set them in PHP Data verification Javascript gives a good user experience but cannot be trusted Server side can be trusted. AJAX What is AJAX. What happens on the client and on the server. How to do it (basics). Python Know basic python syntax Know there is a 3.X and a 2.X Know how to make a functions With default parameters Know how to make an object Self is your friend Self is really your friend Bottle https://bottlepy.org/docs/dev/tutorial.html Example from bottle import route, run @route('/hello') def hello(): return "Hello World!" run(host='localhost', port=8080, debug=True) Other examples return static_file(filename, root='/path/to/your/static/files') @route('/show/') @route('/object/') Google Pagerank have lots of important people point to you then win $$$$