The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
![]()
I am currently working on a reciprocals list for one of my sites. I am wishing to display the results in a series of pages so the page isn't umpteen miles long.
I have the pagination itself working, except it isn't sorting by category. instead, everything is being shown in each category, just broken up by pages. lol I am speculating that it has to do with this query, and I likely have it written wrong: Code:
$get_recip = $vbulletin->db->query_read(" SELECT recipid, categoryid, sitetitle, username, userid, sitelink, sitelinkimg, aboutme, views, votes, rating, joindate, active FROM " . TABLE_PREFIX . "recip_links WHERE active=1 ORDER BY joindate DESC LIMIT " . ($limitlower - 1) . ", $perpage "); Could someone lend this schmuck a hand sorting out why it isn't displaying by category. |
#2
|
|||
|
|||
![]()
Try GROUP BY categoryid
PHP Code:
|
#3
|
||||
|
||||
![]()
I just gave what you wrote up a whirl, but it spits out a database error asking me to check the syntax near "group by". I then dropped the initial category id and tried that, no avail. Also dropped the comma, no avail. lol
I have never used the group by command, so I am not certain of the proper syntax. I tried running a search on google for the syntax, but I found more people asking the same question than I did anything else. I appreciate the assistance. |
#4
|
|||
|
|||
![]()
Sorry the GROUP BY goes before the ORDER BY.
PHP Code:
|
#5
|
||||
|
||||
![]()
I have been playing with this more, and this has worked...partially.
Code:
$get_recip = $vbulletin->db->query_read(" SELECT recipid, categoryid, sitetitle, username, userid, sitelink, sitelinkimg, aboutme, views, votes, rating, joindate, active FROM " . TABLE_PREFIX . "recip_links WHERE categoryid='$categoryid' AND active=1 ORDER BY recipid DESC LIMIT " . ($limitlower - 1) . ", $perpage "); The other test category, which I have 9 test links in is showing the nav, and is showing the first 5 links on the first page (which is how I have it limited), but the second page is blank and isn't showing the remaining links. What would cause the second page to appear blank? --------------- Added [DATE]1205678392[/DATE] at [TIME]1205678392[/TIME] --------------- I got it. I wasn't passing the categoryid within the page navigation itself. All works now. Thanks for the help MoT3rrer |
![]() |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|