![]() |
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? |
SELECT *
FROM user AS user LEFT JOIN profilefield AS profilefield ON (user.userid=profilefield.userid) |
Hi, I get this response:
#1054 - Unknown column 'profilefield.userid' in 'on clause' In the profilefield table there isn't a userid column. |
Edit: see Lynne's answer below.
|
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 |
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. :o
|
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. :)
|
Thank you, that worked.
|
All times are GMT. The time now is 10:04 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|