query($query); // Output if ($result->num_rows===0) { echo('Everything looks fine, Lychee has not reported any problems!'); } else { while($row = $result->fetch_row()) { // Encode result before printing $row = array_map('htmlentities', $row); // Format: time TZ - type - function(line) - text printf("%s - %s - %s (%s) \t- %s\n", $row[0], $row[1], $row[2], $row[3], $row[4]); } } } else { // Don't go further if the user is not logged in echo('You have to be logged in to see the log.'); exit(); } ?>