Review for the Midterm 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 Databases 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 3rd normal form and database decomposition The many types including longblob date and time types decimal(a,b) enum Indexes Keys Know the keywords select from where order by (asc or desc) limit create table with non null, default, key drop table show tables describe table fred insert into tablename values (1,"a") min(colname) and max(colname) subqueries select * from table where colname < (select min(price) from table2) select * from table where name in (select name from table2) PHP print_r fopen fread unset($varname) isset($varname) empty($varname) header command (i.e. header("Location: http://www.google.com"); Variable scoping rules Built in arrays $_GET $_POST $_COOKIE $_SESSION $_REQUEST Objects calling a method constructing an object and new $this->variable constructors and __construct() destructors and __destruct() class variables and 'var' and $this local variables and local($variable) global variables Error supression with @ Error checking with die Resource limts with the config file 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 Images header content type Databases Know some way to fetch data like mysql_query mysql_num_rows mysql_fetch_row mysql_connect mysql_select_db Error checking Arrays Can be indexed by numbers and strings Sometimes called an associative array or a dictionary Can be in non-index order Can be sorted and shuffled and pushed and popped. Regular Expression Functions preg_split preg_grep preg_match preg_replace Don't forget the delimiters "/fred/" "$fred$" Modifiers especially /i for ignore case