To fetch the prev cat i use in php
SELECT * FROM Category
WHERE Name < ( SELECT Name FROM Category WHERE CategoryID = $catid )
ORDER BY Name DESC limit 0,1
To fetch the next cat
SELECT * FROM Category
WHERE Name < ( SELECT Name FROM Category WHERE CategoryID = $catid )
ORDER BY Name ASC limit 0,1
Unfortunately i have no idea how to tell this to LSQL.
Then i have to check, if a cat is the last or the first one, because the prev to the first should be the last, the next to the last one should be the first one.
Is there any solution for this, please?
Hmmm, i just understand that i still have the name.
Then i should maybe ask:
SELECT * FROM Category
WHERE Name < $name
ORDER BY Name ASC limit 0,1
I will try it in a minute ...
SELECT * FROM Category
WHERE Name < ( SELECT Name FROM Category WHERE CategoryID = $catid )
ORDER BY Name DESC limit 0,1
To fetch the next cat
SELECT * FROM Category
WHERE Name < ( SELECT Name FROM Category WHERE CategoryID = $catid )
ORDER BY Name ASC limit 0,1
Unfortunately i have no idea how to tell this to LSQL.
Then i have to check, if a cat is the last or the first one, because the prev to the first should be the last, the next to the last one should be the first one.
Is there any solution for this, please?
Hmmm, i just understand that i still have the name.
Then i should maybe ask:
SELECT * FROM Category
WHERE Name < $name
ORDER BY Name ASC limit 0,1
I will try it in a minute ...