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).
<?php
$usersselect = @mysql_query("SELECT
ID,
user_login,
user_email,
user_url
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>
</table>
<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.