Posted by Oli Filth on 11/16/05 18:07
Sandman wrote:
>
> what I would like is something like this:
>
> select * from blog where member = 12 and category = 'Sports' and id = 12345
> limit -5, 5;
SELECT * FROM blog
WHERE ... AND id < $currentID
ORDER BY id DESC
LIMIT 5
UNION
SELECT * FROM blog
WHERE ... AND id >= $currentID
ORDER BY id
LIMIT 6
Second limit needs to be 6 to make sure the current ID is included.
--
Oli
Navigation:
[Reply to this message]
|