I wrote the attached script to take the ten most recent weblog entries in a database, and return them with the most recent first. When two entries occur on the same date, I only want the date listed once. This script will indeed do that, but with a strange side effect. The second post, when $i=1, appears twice in a row (once as I would like it, without a date, and once with). The final post, when $i=4 (there are currently only 5 entries in the database), does not appear at all.
I added echo $i; to see if that would shed any light on the situation, but it does not. The output looks like this:
$i=0
Post 1
$i=1
Post 2
$i=2
Post 2 (again)
$i=3
Post 3
$i=4
Post 4
Post 5 never appears. Comment out lines 16-19 (all mention of $date2), and the script displays all 5 posts, but the date appears on all of them. See the first 5 posts at this address for an example of how this displays:
http://www.digitalovertone.com/weblog/http://www.digitalovertone.com/weblog/
Any thoughts?