mysqli_num_rows does nothing even remotely similar to mysql_result.
The replacement for mysql_result
in mysqli in this case would be to fetch the entire row and use the first element only, something like;
$result = mysql_query("SELECT COUNT(*) FROM xxx limit 2") or die(mysql_error());
$row = mysqli_fetch_row($result);
$count = $row[0];
for($i=0; $i<$count;$i++){
echo '';
}