Q:

php iterate through mysql dosent show most recent entry

                $query = "SELECT * FROM `reportlog` WHERE `entity` = '$ent'";
            mysqli_query($db, $query) or die('Error querying database.');

This code does not show the first entry when there is only one entry
and then shows the fist but not the second, then 1 2 but not 3 and so on.
Basically it dose not ever show the most recent entry. I have no idea why.
Please help me
              $result = mysqli_query($db, $query);
            $row = mysqli_fetch_array($result);

       echo "user \t date \t                   note \n";
             while ($row = mysqli_fetch_array($result)) {
             echo $row['user'] . " \t " . $row['date'] . " \t " .  $row['note']. " \n";
            }

A:

Remove the first:
$row = mysqli_fetch_array($result);

This is fetching the first row and removing it from the result set, so your mysqli_fetch_array() in the while loop is starting from the second row.
FYI...  If you change your query to only get columns you want:
SELECT `user`, `date`, `note` FROM `reportlog` WHERE `entity` = '$ent'

Then you can just do:
echo implode(" \t ", $row) . " \n";

