Taking me login form to another level [php]

Well, Hello again php gurus!

what im trying to get here is to adapt my current login forms check.php file so it can use member levels

for example
0 = guest
1 = member
2 = admin

if someone logs in with the level 2 they will be taken to admin.php and so forth…

Here is my currect check.php file :


<?php
include('../config/config.php');

// Connect to server and select databse.
$connect = mysql_connect("$dbhost", "$dbuser", "$dbpass")or die("cannot connect");
mysql_select_db("$dbname")or die("cannot select DB");

// username and password sent from signup form
$myusername=$_POST['myusername'];
$in=$_POST['mypassword'];

$symb = array("$", "=", "*", "%", "\";", ");");
$pass = str_replace($symb, "", $in);
$sql="SELECT * FROM $tbl_name WHERE username='$myusername' and password='$pass'";
$result=mysql_query($sql);


// Mysql_num_row is counting table row
$count=mysql_num_rows($result);
// If result matched $myusername and $mypassword, table row must be 1 row
if($count==1){

// Register $myusername, $mypassword and redirect to file "login_success.php"
session_register("myusername");
session_register("mypassword");
header("location:admin.php");
}
else {
header("location:task.php?status=0");
}
?>

Thank you!!!