What you are doing is counting the number of times the username and password match. You aren't actually pulling any records from the table.
You may want to do a query like this ...
$query_result = mysql_query("select * from agent where username='$username' && password='$password'");
Then do a mysql_fetch_row to extract the actual data ...
$data = mysql_fetch_row($query_result);
If your table has, say three fields (username, password, age), you would reference the results like this ...
$data[0] -> is the username
$data[1] -> is the password
$data[2] -> is the age
HTH