sql in separate file

master
Matt Huntington 8 years ago
parent 61dba44d59
commit 919940a06f

@ -0,0 +1 @@
SELECT * FROM people

@ -12,7 +12,8 @@ class Person {
class People {
static function find(){
$result = pg_query('SELECT * FROM people');
$query = file_get_contents(__DIR__ . '/../database/sql/find.sql');
$result = pg_query($query);
$people = array();
while($data = pg_fetch_object($result)){
$people[] = new Person($data->name, intval($data->age));

Loading…
Cancel
Save