I am sure the error is staring me in the face, but I will still ask it, as I have spent several hours already trying to figure it out. I don't know why, but the query causes HTML to stop rendering entirely. Not just within the PHP tag, but all HTML. Below is a very trimmed down version of my code, just enough to get the error. What should be displayed is the number 1 followed by a var_dump, then 2, var_dump, etc... but all I get is 1, then the error.
<?php
class Calendar {
private $DBConnect = NULL;
function __construct() {
$ErrorMsgs = array();
$DBConnect = new mysqli("localhost", "user", "pass", "db");
if ($DBConnect->connect_error)
$ErrorMsgs[] = "The database server is not available. Connect Error is " . $mysqli->connect_errno . " " . $mysqli->connect_error . ".";
$this->DBconnect = $DBConnect;
}
public function getMonthlyCalendar($Year, $Month) {
for ($i = 1; $i <= 31; ++$i) {
echo $i;
$SQLstring = "SELECT EventID, Title FROM event_calendar WHERE EventDate='2014-05-$i'";
$QueryResult = $this->DBConnect->query($SQLstring);
var_dump($QueryResult);
}
}
}
$Calendar = new Calendar();
$Calendar->getMonthlyCalendar(2014, 5);
?>