prepare() is a fast and safe method for performing a MySQL query
$stmt = $wpdb->prepare("SELECT user_id FROM $wpdb->usermeta AS um
WHERE ( um.meta_key='last_name' AND um.meta_value LIKE '%%%s%%') OR
(um.meta_key='last_name' AND um.meta_value LIKE '%%%s%%')
ORDER BY um.meta_value
LIMIT 150",
$usersearch, $usersearch );
//results are cached in the variable $results using get_col()
$results = $wpdb->get_col( $stmt );
} ?>
";
echo "
";
//$u is going to be the users id
echo $u;
echo "
";
//now we can loop through the $metanames variable
foreach($metanames as $m){
echo "