Skip to content

Commit c4b32a9

Browse files
committed
7. Created the Country model
1 parent 9845bd1 commit c4b32a9

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

app/models/Country.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
class Country {
3+
private $db;
4+
5+
public function __construct() {
6+
$this->db = new DatabaseController;
7+
}
8+
9+
public function getCountries() {
10+
$this->db->query("SELECT * FROM `countries`");
11+
12+
$result = $this->db->execute()->fetchAll();
13+
14+
return $result;
15+
}
16+
}

0 commit comments

Comments
 (0)