delete uses postgres

master
Matt Huntington 8 years ago
parent 1cad051928
commit 9895e13f1c

@ -0,0 +1 @@
DELETE FROM people WHERE id = $1

@ -29,16 +29,11 @@ class People {
return self::find();
}
static function delete($index){
$people = array();
$people[] = new Person('joni', 52);
$people[] = new Person('bob', 34);
$people[] = new Person('sally', 21);
$people[] = new Person('matt', 37);
array_splice($people, $index, 1);
static function delete($id){
$query = file_get_contents(__DIR__ . '/../database/sql/delete.sql');
$result = pg_query_params($query, array($id));
return $people;
return self::find();
}
static function update($index, $updatedPerson){
$people = array();

Loading…
Cancel
Save