The users represent everyone who is registered and who is of type "administrator." The id is simply their user id from within the database. What I'm trying to do is take this query that is inside the array and output their results in a foreach where the id and username is used for further conditional processing.
Something sorta like this:
Code: Select all
foreach user as id=>user{
echo "{$username}\'s id is {$id}.<br />";
}
The function I'm using to execute the aforementioned query is the following:
Code: Select all
function get_vtl_user_roles(){
global $vtl_roles,$vtldb;
$this_role = "'[[:<:]]administrator[[:>:]]'";
$query = "SELECT DISTINCT id, user_login FROM $vtldb->users WHERE ID = ANY (SELECT DISTINCT user_id FROM $vtldb->usermeta WHERE meta_value RLIKE 'administrator') ORDER BY ID ASC LIMIT 10000";
$users_of_this_role[] = $vtldb->get_results($query);
return $users_of_this_role;
}
That function grabs the usernames and ids from the appropriate mysql table and attempts to insert them into "$users_of_this_role" array. Unfortunately, I can't seem to understand why the array is making it into a multi-dimensional one. The function "get_results()" is from Wordpress (as is most of this).