How to get the user group from the database
-
Hi there,
I’m starting in WP.
I’m quite familiarized with database, but I can’t find a way to find the data from WP-user-group, and use it with SQL queries for example, in seperate PHP pages.My need is very simple.
My site users are either teachers or students (I register them myself).
I need to create groups so I can then use SQL queries to create customized students lists for each teacher. I created 2 user types within WP-User-Group: “Student” and “Teacher”Example : I’ve got 2 groups called “English 1” and “English 2”, with, in each group, 3 users with status “Student” and 1 user with status “Teacher” which is actually the same teacher for both groups.
I’d like to use Sql query to create, for each teacher, a simple list of “Groups” they’re teaching to.For this, I’d need to easily find the info in the database, and I can’t manage to do so !
I hope someone can help me.
Thanks in advance !
- The topic ‘How to get the user group from the database’ is closed to new replies.