You want to know if the user with uid $uid has a level of $level? All very simple SQL.
$query = "SELECT COUNT(*) FROM users WHERE uid=$uid AND level=$level"; // Just count them.
$result = mysql_query($query);
$count=mysql_result($result, 0, 0);
if($count>0)
{... // Yep, it's there
}
You want to know what level they have?
$query = "SELECT level FROM users WHERE uid=$uid";
$result = mysql_query($query);
if(mysql_num_rows($result)==0)
{ ... // That uid isn't even in the table.
}
else
{
$level=mysql_result($result, 0, 0);
if($level==10)
{... // Level Ten User!
}
}
I am of course assuming there is only one user with a uid of $uid. If there isn't, then it's not a very u id.
SELECT * is a last-ditch construct you use when you haven't the foggiest idea what there is and so you have to resort to asking for everything.