first, u use mysql_query directly... i wonder whether u already connect to the mysql or not since u didn't note that u are connected or not... please confirm me.
u should have something like mysql_connect() and mysql_select_db()...
then,
$query=mysql_query("SELECT * FROM users WHERE username='$username' AND password='$password'");
i assume when $rs = mysql_fetch_array($query),
print_r($rs);
i show see the information about $username.
u got a weird style... u don't seems to indent ur code...
ah ha... maybe ur problem...
u do two times
$row=mysql_fetch_array($query);
the second mysql_fetch_array will return false becoz u already fetch the 1 recordset already before u do $_SESSION['id']=$row['id];
maybe
// $row=mysql_fetch_array($query); // mark this line as comment.
$uname=$row['usename'];