Now i found out that the last time i have done something like this i have select * and throw everything in an array. Then i took one before and one after my ID.
Now i found:
SELECT row FROM
(SELECT @rownum:=@rownum+1 row, a.*
FROM bCategory a, (SELECT @rownum:=0) r
ORDER BY sort,Pfad,Name) as something
WHERE ID = 3300
But where i put this:
WHERE FatherID = 33 AND Number_of_Links > 0
Then in a second step i can choose:
SELECT * FROM bCategory ORDER BY sort,Pfad,Name LIMIT result from_above, 3
to have previous, ID, next.
But as mentioned, i need a more complex first query, becaue now we select from all cats.
Now i found:
SELECT row FROM
(SELECT @rownum:=@rownum+1 row, a.*
FROM bCategory a, (SELECT @rownum:=0) r
ORDER BY sort,Pfad,Name) as something
WHERE ID = 3300
But where i put this:
WHERE FatherID = 33 AND Number_of_Links > 0
Then in a second step i can choose:
SELECT * FROM bCategory ORDER BY sort,Pfad,Name LIMIT result from_above, 3
to have previous, ID, next.
But as mentioned, i need a more complex first query, becaue now we select from all cats.