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 :


// 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

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

// Mysql_num_row is counting table row
// If result matched $myusername and $mypassword, table row must be 1 row

// Register $myusername, $mypassword and redirect to file "login_success.php"
else {

Thank you!!!