Here is code for you to try:
// List authors by first letter of last name
$sql = "SELECT umfirst.user_id, umfirst.meta_value AS first_name, umlast.meta_value AS last_name
FROM $wpdb->usermeta umfirst, $wpdb->usermeta umlast
WHERE umlast.meta_key = 'last_name'
AND umfirst.meta_key = 'first_name'
AND umfirst.user_id = umlast.user_id
AND umlast.meta_value LIKE 'A%'
ORDER BY last_name, first_name";
$rows = $wpdb->get_results($sql);
foreach ($rows as $row) {
$cimy_value = get_cimyFieldValue($row->user_id, 'PHONE');
$user_data = "$row->last_name, $row->first_name $cimy_value";
if (is_user_logged_in()) {
$output = "<a href=\"" . get_bloginfo('url') . '/wp-admin/user-edit.php/?user_id=' . $row->user_id . '" alt="" >' . $user_data . '</a>';
} else {
$output = $user_data;
}
echo "$output<br />\n";
}
(note to self: from miataclub29 testphp.php)