Initial backend folder structure and setup
This commit is contained in:
16
app/Models/Project.php
Normal file
16
app/Models/Project.php
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
class Project {
|
||||
private $conn;
|
||||
private $table = "projects";
|
||||
|
||||
public function __construct($db) {
|
||||
$this->conn = $db;
|
||||
}
|
||||
|
||||
public function fetchAll() {
|
||||
$query = "SELECT * FROM " . $this->table;
|
||||
$stmt = $this->conn->prepare($query);
|
||||
$stmt->execute();
|
||||
return $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user