I have a basic blogging system with many users / blogs and then each blog has many posts.

I want to be able to number each of the posts from each blog e.g. #1 #2 #3 #4.

I echo out the posts in a foreach like so:

```
SELECT * FROM posts WHERE blogID = :blogID ORDER BY dateposted DESC

foreach:

    $postcontent = $row['postcontent'];

    echo "<div>$postcontent</div>";

endforeach

```

That works fine, but what i want is to be able to say:

```
    echo "<div>$postNumber, $postcontent</div>";

```

I cant just do:

```
$postNumber = $row['ID'];

```

As all of the posts are in one table so the ids are not relevant in that sense.

How can i assign a variable with an increasing number (starting from 1) and give that to each foreach item. 

Thanks!