rendered paste body//database.php
<?php
function getDatabase() {
$db = new mysqli('localhost', 'root', '', 'beerthirty');
if(!$db) {
return false;
}
return $db;
}
?>
//index.php
<?php
include_once("agent.php");
include_once("constants.php");
include_once("database.php");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<title>a yet to be named application</title>
<?php
$agent->init();
$db = getDatabase();
$getCities = "select * from cities";
$cities = $db->query($getCities);
function getCityInformation($cityId) {
$db = getDatabase();