Why exactly would he need the while? I don't really see any use for it there. I use while statements for running through adding something into a database for multiple entries. Now looking better at the code I'd do it something like this:
$i=$db->query("SELECT `awardno` FROM `uawards` WHERE awardno=2 userid={$userid}");
if($db->num_rows($i) > 0) {
$a = $db->fetch_row($i);
echo "You have the award already";
die($h->endpage());
} else if($db->num_rows($i) == 0 && $ir['level'] >= 10) {
$db->query("INSERT INTO `uawards` (`id`, `userid`, `awardno`) VALUES ('',{$userid}, '2')");
echo "
<div class='desc2'>
<div class='citstat'>
<table class='mytable'><tr><td><center>
<font color='green'>Congratulations!</font> you have earned an award!<img src='https://cdn4.iconfinder.com/data/icons/pc_de_hamburg_icon_pack/32x32/bestseller.png'>You have reached level 10</center></td></tr></table></div></div>
";
}