471b3d2f650ab40229871e7d65a09836c2716ff9
[atutor.git] / mods / hello_world / module_news.php
1 <?php
2 /*
3 * Rename the function to match the name of the module. Names of all news functions must be unique
4 * across all modules installed on a system. Return a variable called $news
5 */
6
7 function helloworld_news() {
8         global $db;
9         $sql = "SELECT something FROM a table WHERE date < NOW() LIMIT 3";
10         if ($result = mysql_query($sql, $db)) {
11                 while($row = mysql_fetch_assoc($result)){
12                         $news[] = $row['something'];
13                 }
14         }
15         return $news;
16 }
17
18 ?>