<?php 

$sql = "SELECT strFirstName, strLastName, strCity, strEmail, strPhone, dateEntered, strBonusCode from tblKioskParkPlace2017 left join tblKioskBonusCodesParkPlace2017 on tblKioskParkPlace2017.intBonusCode = tblKioskBonusCodesParkPlace2017.intBonusCodeID";
$result = getFromDatabase($sql);
if (mysqli_num_rows($result) == 0)
{
	$content = "<p>Sorry no entries found</p>";
}
else
{

	while ($row = mysqli_fetch_array($result) )
	{
		$c_first_name = $row['strFirstName'];
		$c_last_name = $row['strLastName'];
		$c_email = $row['strEmail'];
		$c_phone = $row['strPhone'];
		$c_city = $row['strCity'];
		$c_date = $row['dateEntered'];
		$c_bonus_code = $row['strBonusCode'];

		if ($c_bonus_code == '')
		{
			$c_bonus_code = 'No code';
		}

		$content .= '<tr><td>'.$c_first_name.'</td><td>'.$c_last_name.'</td><td>'.$c_email.'</td><td>'.$c_phone.'</td><td>'.$c_city.'</td><td>'.$c_date.'</td><td>'.$c_bonus_code.'</td></tr>';
	}
}

?>