WP DB query trying JOIN users AND usermeta TABLES

The code below works, it delivers all users, only once in the return. But I am trying to list my authors and editors with user_levels of 2 (author) and 7 (editor) [or 7 and below] on a page. I have crawled the CODEX and learned that user_login (in wp_users) and user_level (in wp_usermeta) are in different tables.

But the code below is only half of the info i need (it is from the wp_users TABLE); when I try to JOIN the wp_usermeta TABLE it fails; (the structure of the db wp_usermeta TABLE is weird).

           $usersselect = @mysql_query("SELECT
                   FROM wp_users
                   ORDER BY ID");

            while ($usersarray = mysql_fetch_array($usersselect)) {
                $userid = htmlspecialchars($usersarray["ID"]);
                $userlogin = htmlspecialchars($usersarray["user_login"]);
                $useremail = htmlspecialchars($usersarray["user_email"]);
                $userurl = htmlspecialchars($usersarray["user_url"]);

            echo("<table width='460' border='0' cellspacing='0' cellpadding='3'>
            <tr><td width='200' align='center' valign='middle' border='0'>
            <a href='$userurl' target='_blank'><img src='[B]$picture190[/B]'></a></td></tr>
                        <tr><td align='left' valign='middle'>Name: $userlogin</td></tr>
                        <tr><td align='left' valign='middle'>Level: [B]$userlevel[/B]</td></tr>
                        <tr><td align='left' valign='middle'>Email: $useremail</td></tr>
                        <tr><td align='left' valign='middle'>Phone: [B]$phone[/B]</td></tr>
                        <tr><td align='left' valign='middle'>Fax: [B]$fax[/B]</td></tr>
                        <tr><td align='left' valign='middle'>Website: $userurl</td></tr>
            <hr width='300' size='1' color='#999999' noshade>"); }

This metadata is in the wp_usermeta TABLE,

$userlevel = wp_user_level
                $phone = aim;
                $fax = yim;
                $picture190 = picture"

Also, I am not sure if my WP3 query syntax is right; if anyone could stear me in the right direction so I can write correct WP DB query requests in the future I would appreciate it. My old-school <?PHP> skills are showing.

please run

SHOW CREATE TABLE wp_usermeta 

and please indicate where the user level is located

the wp_user table runs the field across the top (ie. ID, user_login, user_email, user_url); and the wp_usermeta runs only four fields across the top (umeta_id, user_id, meta_key, meta_value) and collects the user meta data in the records down the left, and tracks by the user_id.

yeah, i figured it was something like that

i wonder if you’d be kind enough to run the following query in mysql –


and please indicate where the user level is located, i.e. what values in which columns to search for in order to find the user level