Make DOA query functions public
Some checks failed
continuous-integration/drone/push Build is failing
continuous-integration/drone/pr Build is failing

This commit is contained in:
Tyler Perkins 2022-12-23 16:13:35 -05:00
parent b621ced611
commit 61e0fba181

View File

@ -25,17 +25,17 @@ class Article {
$this->client = mysqli_connect($host, $user, $pass, $db); $this->client = mysqli_connect($host, $user, $pass, $db);
} }
function getAllPosts() { public function getAllPosts() {
$result = mysqli_query($this->client, 'SELECT * FROM post'); $result = mysqli_query($this->client, 'SELECT * FROM post');
return mysqli_fetch_all($result); return mysqli_fetch_all($result);
} }
function getMostRecentPosts($limit){ public function getMostRecentPosts($limit){
$result = mysqli_query($this->client, 'SELECT * FROM post ORDER BY created DESC LIMIT ' . $limit); $result = mysqli_query($this->client, 'SELECT * FROM post ORDER BY created DESC LIMIT ' . $limit);
return mysqli_fetch_all($result); return mysqli_fetch_all($result);
} }
function getPostData($postId) { public function getPostData($postId) {
$result = mysqli_query($this->client, 'SELECT * FROM post WHERE ID = ' . $postId); $result = mysqli_query($this->client, 'SELECT * FROM post WHERE ID = ' . $postId);
return mysqli_fetch_all($result); return mysqli_fetch_all($result);
} }