= 0) { $chartData .= $simpleEncoding[round($simpleLength * $currentValue / $maxValue)]; } else { $chartData .= ‘_’; } } return $chartData; } $conexion = mysql_connect("localhost", "USUARIO", "PASSWORD"); mysql_select_db("rf_21_innodb", $conexion); $query = "SELECT MAX(SurfaceArea) as max_pop from country"; $result = mysql_query($query, $conexion) or die(mysql_error()); $max = mysql_fetch_assoc($result); $max = $max['max_pop']; $query = "SELECT SurfaceArea, Code2 from country WHERE SurfaceArea is not NULL AND SurfaceArea > 0 order by Population DESC"; $result = mysql_query($query, $conexion) or die(mysql_error()); $paises = ""; $data = array(); while ($row = mysql_fetch_assoc($result)) { $data[] = ($row['SurfaceArea']/$max)*100; $paises .= $row['Code2']; } $data = simpleEncode($data); ?>