Question: I have this code working 100%, but it doesn't show the latest details required from the MySQL database.

```
$SQL = "SELECT * FROM wdclients ORDER BY 'id' DESC LIMIT 6";
$result = mysql_query($SQL);
while ($db_field = mysql_fetch_assoc($result)) {
    echo $latest1;
    print $db_field['clientid'];
    echo $latest2;
    print $db_field['cname'];
    echo $latest3;
    print $db_field['cname'];
    echo $latest4;
}

```

The problem now is that I require the code to show only the 6 latest entries in the database. I have over 500 clients in the database but it only shows the first 6 and never update.

The "ID" field in database has set the auto-increment value.

Answer: 
Your first problem is that you used single quotes instead of backticks to delimit that field name.

```
SELECT * FROM wdclients ORDER BY `id` DESC LIMIT 6

```

Ordering by a string literal (`'id'`) doesn't really do anything, so you ended up with the "natural" ordering.

That is, the physical ordering in storage, since MySQL tables have no inherent ordering. And, even though you set `AUTO_INCREMENT` on that ID field, it is not *guaranteed* to yield sequential values forever (e.g. IDs from old, deleted rows could be used).

You should set the ID yourself with a known unique, sequential value if you want to define an actual ordering by insert time.
It's because you have put id in regular single quotes. You have to use backquotes in order for MySQL to parse it into a value:

```
$SQL = "SELECT * FROM wdclients ORDER BY `id` DESC LIMIT 6";

```