Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Topic started by: MisterVertigo on October 22, 2019, 10:29:54 AM

Title: SQL Query Question
Post by: MisterVertigo on October 22, 2019, 10:29:54 AM
Hello all! I'm hoping this is the right place for this. If not, please let me know and I can re-post elsewhere.

I'm trying to run a MySQL query against my SMF database to pull some data that I can then open in a spreadsheet. I'm trying to pull user data (name, e-mail, joindate, usergroup, and membergroups).

I've got the query to get the data I need from the users table, and I know how to do a join to get the Primary Membergroup name. However, when it comes to the Additional Membergroups, users can be a member of several and they are stored as id's separated by a comma in the user table. How can I pull the name of each group instead of just the id for this field?

Thank you in advance for your time!
Title: Re: SQL Query Question
Post by: Arantor on October 22, 2019, 10:31:59 AM
You basically can't in raw SQL.
Title: Re: SQL Query Question
Post by: MisterVertigo on October 22, 2019, 10:35:08 AM
I was kind of afraid of that. If I was going to display on a web page with PHP I know I could do it no problem, but wasn't sure if I could in just SQL. Thank you though!