generated from ToddSproull-WUSTL/V1-CSE330-Group-Template
-
Notifications
You must be signed in to change notification settings - Fork 6
/
functions.php
26 lines (19 loc) · 1012 Bytes
/
functions.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<?php
require 'database.php';
//this function loads all news upon startup
function fetchNews( $mysqli )
{
$request = $mysqli->prepare(" SELECT newsid, newstitle, newstext, newscomments from stories");
return $request->execute() ? $request->fetchAll() : false;
}
// function getAnArticle( $id_article, $mysqli )
// {
// $request = $mysqli->prepare(" SELECT news_id, news_title, news_full_content, news_author, news_published_on FROM info_news WHERE news_id = ? ");
// return $request->execute(array($id_article)) ? $request->fetchAll() : false;
// }
// function getOtherArticles( $differ_id, $conn )
// {
// $request = $conn->prepare(" SELECT news_id, news_title, news_short_description, news_full_content, news_author, news_published_on FROM info_news WHERE news_id != ? ");
// return $request->execute(array($differ_id)) ? $request->fetchAll() : false;
// }
?>