Hola, como están?
Estoy rearmando un rank gens ya que no existe actualmente en ningún lado como yo lo quiero.
La idea es que ordene por puntos de contribución, y que muestre de que gens es. Las tablas y todo esta todo bien, pero a al hora de mostrar de que gens es es cuando ocurre el error. 
Pongo abajo la parte que maneja dichos datos.
Aclaracion: Si pongo row[2] = 1 / row[2] = 2. Muestra siempre la misma imagen (la primera)
Si pongo row[2] == 1 / etc . No muestra ninguna imagen.
<!-- 
Gens Ranking Completo
-->
<style type="text/css">
<!--
.red {
    color: #800000;
}
.grey {
    color: #000000;
}
.gold {
    color: #BEC402;
}
.blue {
    color: #0080FF;
}
.green {
    color: #00FF40;
}
.themain2 {
background: red;
-moz-border-radius: 8px 8px 8px 8px;
}
.topp11 {
background: red;
color: #FFFFFF;
font-weight: bold;
-moz-border-radius: 8px 0 0 0;
}
.topp22 {
	background: red;
	color: #FFFFFF;
	font-weight: bold;
	text-align: center;
}
.topp33 {
background: red;
color: #FFFFFF;
font-weight: bold;
-moz-border-radius: 0 8px 0 0;
}
.trhover {
background: #FFFFFF;
font-family:Verdana, Arial, Helvetica, sans-serif;
font-size:11px;
color:#000000;
}
.trhover:hover{background: #ffeab0;
font-family:Verdana, Arial, Helvetica, sans-serif;
font-size:11px;
color:#000000;
}
.trhover:active{background: #ffeab0;
font-family:Verdana, Arial, Helvetica, sans-serif;
font-size:11px;
color:#000000;
}
.themain2 tr .themain2 {
	font-weight: bold;
	color: #FFF;
	text-align: center;
}
-->
</style>
<br>
  <table  width="800" >
    <tbody oncontextmenu="return false">
   
  
    <td>
    
    <table class="table table-striped table-condensed">
      <thead><tr>
	    <td  align="center"><b>#</b></td>
        <td  align="center"><b>Nombre</b></td>
		<td  align="center"><b>Puntos</b></td>
     <td  align="center"><b>Gens</b></td>
      </tr>
      </thead>
<?
include 'config.php';
$cnn=@mssql_connect($core['db_host'],$core['db_user'],$core['db_password']) or die('Error al conectar con el sql');
$db=@mssql_select_db($core['db_name'],$cnn) or die('Error al conectar con la database');
$killer="select TOP 300 Name, Contribution From Gens_Rank where Family > '0' AND Contribution >= 1 order by Contribution desc";
$sql_killer_check=mssql_query($killer);
//Familia
$Family="select sum(Family) from MuOnline.dbo.Gens_Rank where Contribution > 0";
$sql_Family_check=mssql_query($Family);
$row2=mssql_fetch_row($sql_Family_check);
if ($row[2] == 1 ) { 
   $familyimg ='<IMG SRC="gensrank_images/dlogo.png">';
    }
elseif ($row[2] == 2 ) { 
   $familyimg ='<IMG SRC="gensrank_images/vlogo.png">';
    }
for($i=0;$i < mssql_num_rows($sql_killer_check);++$i)
{
$s=$i+1;
$row=mssql_fetch_array($sql_killer_check);
echo "
<tbody><tr>
		<td  align='center'><b>$s</b></td>
          <td  align='center'><b>$row[0]</b></td>
          <td  align='center'><b>$row[1]</b></td>
	<td  align='center'>$familyimg</td>
        </tr>"; }
        
     
?>
      </tbody></table>
	  
	 
</table>
<!-- 
Gens Ranking Completo
-->
La parte del codigo que maneja eso es:
//Familia
$Family="select sum(Family) from MuOnline.dbo.Gens_Rank where Contribution > 0";
$sql_Family_check=mssql_query($Family);
$row2=mssql_fetch_row($sql_Family_check);
if ($row[2] == 1 ) { 
   $familyimg ='<IMG SRC="gensrank_images/dlogo.png">';
    }
elseif ($row[2] == 2 ) { 
   $familyimg ='<IMG SRC="gensrank_images/vlogo.png">';
    }