This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$students = array( | |
'Andrew', | |
'Caitlin', | |
'Josue', | |
'Genaro', | |
'Amanda', | |
'Ashley F', | |
'Michael', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
############################# | |
# Codeup Server Setup | |
############################# | |
box = 'chef/ubuntu-14.04' | |
hostname = 'codeup-trusty' | |
domain = 'codeup.dev' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE user_role ( | |
user_id INT(10) UNSIGNED NOT NULL, | |
role_id INT(10) UNSIGNED NOT NULL, | |
PRIMARY KEY (user_id, role_id), | |
CONSTRAINT user_role_role_fk FOREIGN KEY (role_id) REFERENCES role (id) | |
ON DELETE CASCADE ON UPDATE CASCADE, | |
CONSTRAINT user_role_user_fk FOREIGN KEY (user_id) REFERENCES `user` (id) | |
ON DELETE CASCADE ON UPDATE CASCADE | |
); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/******************************* | |
* Setup Connection | |
*******************************/ | |
$dbc = new PDO('mysql:host=127.0.0.1;dbname=codeup_demo_db', 'username', 'password'); | |
// Tell PDO to throw exceptions on error | |
$dbc->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// ... | |
} elseif ($input == 'R') { | |
// Remove which item? | |
echo 'Enter item number to remove: '; | |
// Get array key | |
$key = trim(fgets(STDIN)); | |
while ($key < count($items)) { | |
$items[$key - 1] = $items[$key]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class DoMath { | |
public $var; | |
public static $boo; | |
public function addToVar($value) { | |
// $this->var += $value; | |
} | |
NewerOlder