Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

Re: [Robert] Next / previous category

Quote Reply
Re: [Robert] Next / previous category In reply to
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.
Subject Author Views Date
Thread Next / previous category Robert 5061 Aug 3, 2016, 3:06 AM
Thread Re: [Robert] Next / previous category
Robert 4970 Aug 3, 2016, 4:25 AM
Thread Re: [Robert] Next / previous category
Robert 4976 Aug 3, 2016, 4:53 AM
Thread Re: [Robert] Next / previous category
Robert 4979 Aug 3, 2016, 5:01 AM
Thread Re: [Robert] Next / previous category
Robert 4966 Aug 3, 2016, 5:03 AM
Thread Re: [Robert] Next / previous category
Andy 4903 Aug 8, 2016, 1:54 AM
Post Re: [Andy] Next / previous category
Robert 4878 Aug 8, 2016, 2:59 AM