Mikhailtech
12-06-2007, 01:45 AM
Hi,
I have this code:
$xxx= $db->query_read("
SELECT * FROM " . TABLE_PREFIX . "yyy
ORDER BY postdate
");
I'm not very familiar with PHP (I'm just modifying an existing script). Right now this results in an output showing me all the table entries, the top being the earliest, the bottom being the latest. In other words, it would show:
1
2
3
4
5
6
7
8
9 (let's say 9 is the most recently posted entry)
I would like it to show only the 5 latest, with the top being the latest and bottom being the earliest of the 5. I want it to show:
9
8
7
6
5
Can anyone tell me what the syntax would be for this?
I have this code:
$xxx= $db->query_read("
SELECT * FROM " . TABLE_PREFIX . "yyy
ORDER BY postdate
");
I'm not very familiar with PHP (I'm just modifying an existing script). Right now this results in an output showing me all the table entries, the top being the earliest, the bottom being the latest. In other words, it would show:
1
2
3
4
5
6
7
8
9 (let's say 9 is the most recently posted entry)
I would like it to show only the 5 latest, with the top being the latest and bottom being the earliest of the 5. I want it to show:
9
8
7
6
5
Can anyone tell me what the syntax would be for this?