Added new date variable to get log entries of a specified day
Changed to PDO to enhance security.