wpdb LIKE request shows all database data

Can you verify that $_POST[‘name’] is obtaining a value. I suggest echoing it out to the page for debugging (maybe in comment tags if site is live). If $_POST[‘name’] is empty, then all results will be returned because the query will say user_nicename LIKE '%'

Just as a precaution in any case, you should do a conditional check to see if $_POST[‘name’] is set and not empty (if you never want all results returning). If empty or null, then add optional code accordingly, like to display a message that no results were found, etc.. based on how you’d want your application to work.

I suggest breaking up your statement to do the check.. so basically:

$name="";

if(isset($_POST['name'])){

  $name = stripslashes($_POST['name']);

}

echo '<!-- name: '.$name.' -->';

if($name==null || $name==''){ 

  //TODO: like return;

}else {

  $name = $wpdb->esc_like($name).'%';

  ....
}