<?php
	require_once("{$_SERVER['DOCUMENT_ROOT']}/private/includes/initialize.php");
    $mysqli->select_db($secondary_db);
    
	$q="SELECT news_id, news_title, news_image, news_message, DATE_FORMAT(news_date, '%e') AS day, DATE_FORMAT(news_date, '%b') AS month, DATE_FORMAT(news_date, '%Y') AS year, DATE_FORMAT(news_date, '%b %e, %Y') AS date FROM news ORDER BY news_id DESC LIMIT 3";
	$r = $mysqli->query($q);
	for($all_news =[]; $row = $r->fetch_assoc(); $all_news[] = $row);
	
	$q="SELECT event_id, event_title, description AS event_message, event_image, location, DATE_FORMAT(start_date, '%e') AS day, DATE_FORMAT(start_date, '%b') AS month, DATE_FORMAT(start_date, '%Y') AS year, DATE_FORMAT(start_date, '%b %e, %Y') AS date FROM event ORDER BY start_date DESC LIMIT 3";
	$r = $mysqli->query($q);
	for($all_event =[]; $row = $r->fetch_assoc(); $all_event[] = $row);
?>