I see you are trying to find out if the user already exists in 3 different tables, but the way you handle this is a bit incorrect. This is what the SQL query would look like generated by your php:
SELECT * FROM customer, admin, staff WHERE username='$myusername' and password='$mypassword'";
But you are handling this query in a wrong way as you would now get the cartesian result (for every row in table1 - show every row in table2). You should instead union the tables together like this:
SELECT * FROM customer UNION ALL SELECT * FROM admin UNION ALL SELECT * FROM staff WHERE username='$myusername' and password='$mypassword'";
And as said, keep your information in a global $_SESSION array.
Also, not that this is faulty perse, but there is no need to use double quotes around your variables in the following lines of code, as those variables are already declared as strings.
mysql_connect("$host", "$username", "$password")or die("cannot connect");
mysql_select_db("$db_name")or die("cannot select DB");