As mentioned above by ginerjm there are some poor techniques used, but that's not the issue at hand.
@mysql_select_db($database) or die( "Unable to select database");
$query="SELECT * FROM agents";
$result=mysql_query($query) or die(mysql_error());
if($num > 0)
$sql = "SELECT agent FROM agents WHERE agent='$_POST[agent1]'
$result2 = mysql_query($sql) or die("Query died: fpassword");
$num2 = mysqli_num_rows($result2);
if($num2 > 0) //password matches
echo "match it is !!";
To get to the actual issue, you're query needs to be able to find the right row. First, you're using both MySQL and MySQLi. Ditch MySQL since it's deprecated and MySQLi is better.
// This adds slashes to apostrophes so your query will work properly.
$agent = mysqli_real_escape_string($con, $_POST['agent1']);
$street = mysqli_real_escape_string($con, $_POST['street1']);
// If there is an error in the query, this will kill your script and tell you what the error is so you can fix it immediately.
$sql = mysqli_query($con, "SELECT agent FROM agents WHERE agent='$agent' AND street='$street'") or die(mysqli_error($con));
Hope this helps.