please try this:
$get_id = "SELECT parent_user_id FROM mlm WHERE user_id='".$current_user_id ."'";
$get_name = "SELECT login_id FROM mlm WHERE user_id='".$get_id ."'";
I have just edited the query. Now second thing is that $get_id is the variable containing the query so if you want to write the sub-query write it like below:
you below if parent_user_id from the sub query will return 1 value
$query = "SELECT login_id FROM mlm WHERE user_id=(SELECT parent_user_id FROM mlm WHERE user_id='".$current_user_id ."')";
use below if the sub query will return multiple values:
$query = "SELECT login_id FROM mlm WHERE user_id IN (SELECT parent_user_id FROM mlm WHERE user_id='".$current_user_id ."')";
and Then try print_r($ref);
you would get the value in the array. and once you see the value use the proper index of the array to get the value.