Please have a look at this mysql query. What it should do is pretty simple – list dates, created from timestamps not older than 10 days.
It works, but not perfectly …
- If I have only 1 timestamp matching, I have 0 results.
- If I have 2 timestamps matching, I have 1 results.
- if I have 3 timestamps matching, I have 2 results
- … and so on…
So the newest timestamp in the table is always ignored by the query, WHY ?!
$timestamp_now = date('U');
$timestamp_10_day_back = $timestamp_now - 864000;
mysql_select_db("$db_visitors");
$sql = "SELECT DATE(FROM_UNIXTIME(visitors_timestamp))
FROM visitors
WHERE visitors_timestamp > $timestamp_10_day_back
ORDER BY visitors_timestamp DESC";
$sql = mysql_query($sql);
$row = mysql_fetch_array($sql);
while($row = mysql_fetch_array($sql)) {
echo $row[0] . "<br>";
}
Just remove
…which is swallowing your first result