$users=$DB_site->query("SELECT userid,username,usertitle FROM user WHERE username LIKE '%".addslashes(htmlspecialchars($findname))."%' ORDER BY username");
$field=$DB_site->query("SELECT field14 FROM userfields WHERE userid=$users[userid]");
echo "<table>";
if ($DB_site->num_rows($users)>0) {
echo "<tr><td nowrap><p><b>Team Members Found:</b></p></td>".iif($perms[ismoderator] or $bbuserinfo['usergroupid']==25, "<td nowrap><p> </p></td>", "").iif($perms[ismoderator] or $bbuserinfo['usergroupid']==25, "<td nowrap><p> </p></td>", "")."</tr>\n";
while ($user=$DB_site->fetch_array($users)) {
echo "<tr><td nowrap><p>$user[username] - $field[field14]</p></td>".iif($perms[ismoderator] or $bbuserinfo['usergroupid']==25, "<td nowrap><a href=\"user.php?action=viewuser&userid=$user[userid]\"><p>[view user]</a> <a href=\"user.php?action=edituser&userid=$user[userid]\">[Edit User]</a></p></td>", "")."</tr>\n";
}
can anyone fix this code so it will show the contents of profile field 14 next to the username....I think it needs to fetch the rray of $users and $field but Im not sure how its done