The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
![]()
What is the query to run (I'm guessing involves LEFT JOIN), to get the required information to display the title of the styleid a user is using?
Is a while() function required too? If so, what do I place? Are we fetching an array? |
#2
|
|||
|
|||
![]() Code:
mysql> SELECT s.title FROM user u, style s WHERE u.userid = 1 AND s.styleid = u.styleid; +------------+ | title | +------------+ | Default vB | +------------+ 1 row in set (0.26 sec) |
#3
|
|||
|
|||
![]()
That query just gives me errors, what's the query I could place in a vB file?
$style=$DB_site->query("SELECT s.title FROM user u, style s WHERE u.userid = '$userinfo[userid]' AND s.styleid = u.styleid"); That also doesn't work, I'm not sure what to do, I just want to be able to put a variable in a template, and it output not the user viewing the page, but users' style sets...it's for the memberlist.. |
#4
|
|||
|
|||
![]()
ok I figured it out for myself, I used this:
PHP Code:
|
#5
|
|||
|
|||
![]()
Make sure $userinfo['userid'] (BTW, /me smacks N9ne for using constants instead of strings in array keys) is set correctly. The query works as you can see.
|
#6
|
|||
|
|||
![]()
ok there must be something wrong with the code, because:
I have 3 users on my localhost (I just created some random users), and... It shows nothing for me... For the user below me in the memberlist, it shows the style I'm using... For the 3rd user, it shows the second style on the board (there's only 2), even though he's using the first style... I'm clueless, i'm about to give up this, I could've sworn something with LEFT JOIN must be done for this to work properly... |
#7
|
|||
|
|||
![]()
Check their styleids and that they're all 1 (i.e., not 0).
|
#8
|
|||
|
|||
![]()
All styleids are correct.
|
![]() |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|