Review for the final
Databases
Transactions
ACID properties
Difference between a table and a database
Indexes, good or bad?
3rd normal form and eliminating inconsistency
SQL
select
insert
insert into
tablename values ('a', 1, '3.0');
joins
select * from
table1, table where column1 = column2;
subqueries
select * from
table where column IN/= (select colname from table);
like
select * where name
like “steve”;
Delete
delete from tablename where blah blah blah
Create
create table
steve(name char(10));
Types
numeric types
Date types
blob/longblob
char[n] vs varchar[n]
Money types
not null
default
autoincrement
What is an SQL injection attack (i.e. little bobby tables)
Regular Expressions
?
*
+
.
/s /S /w /W /d /D etc.
$ and ^
[abc]
[a|b|c]
abc{1,4}
modifiers like “/steve/i”
Regular Expression PHP Methods
preg_match and preg_match_all
preg_replace
preg_split
PHP
Loops
for
foreach($arrays as $item)
foreach($array as $item=>$key)
while
do while
variables
local vs class vs global vs superglobal
builtin variables like $_COOKIES $_REQUEST $_GET etc.
$_SERVER
methods and functions
Names not case sensitive!
how do you declare a return type?
How do you make a default parameter?
How do you force a parameter to be a type?
http://www.php.net/manual/en/language.oop5.typehinting.php
Objects
constructors __construct()
Does not call the
superclass's constructor.
parent::__construct
destructors __destruct()
Does not call the superclass's destructor
parent::__destruct()
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”???
Arrays
remember, arrays are really has tables!
remember, arrays are really has tables!
ToString
die
string concatenation
MYSQL
mysql_real_escape_string
mysql_connect
mysql_query
print_r
Cookies
Uses
Size limit
what to do if turned off
Can they be trusted?
When can you set them in PHP
Images
lossless vs lossy
png vs gif
HTTP
GET vs POST
What gets cached
How do you turn off caching
the header command
Compression – just know it can happen
Imagemaps
<img src=blah usenmap=#thing>
<area shape=ploygon coords=”1,2,3,4,5,6”>
<area shape=circle coords=”1,2,3”>
<area shape=rect coords=”1,2,3,4”>
</map>
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
Django
Only basics
How do you map a URL to a view
How does a view use a template
How does a model relate to an SQL table
There is an id field
makemigration and migrate are things
Data verification
Javascript gives a good user experience but cannot be trusted
Server side can be trusted.
Cross site scripting attacks
Just know the basics .. what is it and why
AJAX
What is AJAX.
What happens on the client and on the server.
How to do it (basics).