Changed model structure

This commit is contained in:
2017-09-08 16:25:24 +07:00
parent 882e635081
commit 210c96e150
3 changed files with 39 additions and 51 deletions

View File

@@ -34,24 +34,4 @@ class Post extends \Core\Model
]
);
}
public function showCategories()
{
try {
$db = static::connectDB();
$sql = "SELECT * FROM kategori";
$query = $db->prepare($sql);
if ($query->execute()) {
if ($query->rowCount() > 1) {
$results = $query->fetchAll(\PDO::FETCH_ASSOC);
return $results;
}
}
} catch (PDOException $e) {
throw new \Exception($e->getMessage(), 444);
}
}
}