The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
SQL query to select username and certain profile fields?
I need to run a query to select the username and certain custom profile field IDs in a list? I can do that for the usernames but am not sure how to pull in the other data.
Can someone help me out? |
#2
|
||||
|
||||
SELECT *
FROM user AS user LEFT JOIN profilefield AS profilefield ON (user.userid=profilefield.userid) |
#3
|
|||
|
|||
Hi, I get this response:
#1054 - Unknown column 'profilefield.userid' in 'on clause' In the profilefield table there isn't a userid column. |
#4
|
|||
|
|||
Edit: see Lynne's answer below.
|
#5
|
||||
|
||||
I don't know that you really want the profilefield table. That is the table that saves the profilefield information that the admin inputs to create the profilefields. When the user fills out a profilefield, his information is stored in the userfield table. So...
Code:
SELECT username, fieldX, fieldY, fieldZ FROM user LEFT JOIN userfield ON(user.userid=userfield.userid) |
Благодарность от: | ||
kh99 |
#6
|
|||
|
|||
Lynne is right of course. I even looked at the database to make sure I was getting the right table, then spaced out and used profilefield instead.
|
#7
|
||||
|
||||
LOL Kevin. The only reason I knew was because I had a question about that recently and I also thought it was the profilefield table until I looked it up and realized otherwise.
|
#8
|
|||
|
|||
Thank you, that worked.
|
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|