I do not know what “clan roster” is, and when I search that term on the Internet there is only things related to video game teams. Anyway, you can extract the user’s data from the WordPress database with a SQL query like this, where “wp_users” is the name of the table:
SELECT * FROM wp_users ORDER BY ID ASC;
And if you want to combine this query with the WordPress functions then you can use the global variable “wpdb” and the “get_results” method to extract the information in a way that you can manipulate with PHP, like this:
global $wpdb;
if ( $wpdb ) {
$query = 'SELECT * FROM wp_users ORDER BY ID ASC';
$results = $wpdb->get_results( $query, OBJECT );
var_dump( $results );
}
Yeah im trying to build a clan roster with certain users registered on my site
so lets say clan leader is wordpress id 1/or specific username
co-leader is another id/specific name
creating a table to put these in i just dont know how to grab specific names i want
thanks for the help! trying to learn queries here hah!
To extract the data of an user following a filter you can use the keyword “WHERE” in conjunction with the “SELECT” statement as you can see here [1]. Following my previous example, you could run a SQL query like this to extra the information of one user account.
SELECT * FROM wp_users WHERE user_login = 'admin' LIMIT 1;
WordPress has a page with information [2] of how to use the global variable “wpdb” to query the database, so if you want to learn a few tricks to customize your website check that reference.
[1] https://dev.mysql.com/doc/refman/5.7/en/select.html
[2] https://codex.wordpress.org/Class_Reference/wpdb