un buen amigo me está enseñando ha hacer esto. Pero me sale un error que no sé como solucionarlo
  Cita:   
y este es el script:Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /mnt/filer1/web/cmblackriver/htdocs/index2.php on line 358
 
Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /mnt/filer1/web/cmblackriver/htdocs/index2.php on line 365
 Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /mnt/filer1/web/cmblackriver/htdocs/index2.php on line 365
Código PHP:
   <?
$user = "cmblackriver";
$pass = "*****";
$data = "cm4anoti";
$host = "pub-db.m2kcore.com";
function Conectarse($host,$user,$pass,$data)
 
{ if (!($link=mysql_connect($host,$user,$pass))
)
 { 
 echo "Error conectando a la base de datos."; 
 
exit(); 
} if (!mysql_select_db($data,$link)) 
{ 
echo "Error seleccionando la base de datos.";
 exit();
  }
  }
$link = Conectarse($host,$user,$pass,$data);
 
$sql = "select * from pub-db.m2kcore.com";
 
$result = mysql_query($sql,$link);
while ($row = mysql_fetch_array($result)) {
$Paginas = count($row["mensajes"]) / 10;
echo "<b>Historial de noticias : </b>";
for($i = 0; $i < $Paginas; $i++) {
echo "<a href=index.php?paginado=". $i * 10 .">". ( $i + 1 ) ."</a> \n";
}
}
mysql_free_result($result);
mysql_close($link);
 
?>    enga os espero
un saludo
 
 
