<?

$n_mes = 0;
include('concha.php');
mysql_connect ("$host", "$usuario", "$contra");
mysql_select_db ("$basedatos");

$sql = "SELECT * FROM visitas ORDER BY date DESC LIMIT 30";

$consulta = mysql_query ($sql);
while ($row = mysql_fetch_array($consulta))
{
$n_mes1 = $row["n"];
$n_mes = $n_mes + $n_mes1;






}
mysql_free_result($consulta);?>


 <?php $n_mes = $n_mes / 30; 
 
 
 $usuario = "xpace_gero";


$contra = "Gero123@";


$basedatos = "xpace_radios";
 
 
 mysql_connect("$host","$usuario","$contra");


$sSQL="

UPDATE `mas_vistas` SET `prom` = '$n_mes' WHERE `mas_vistas`.`dom` = '$dom';

";

echo 
$sSQL;


mysql_db_query("$basedatos",$sSQL);

 
 ?> <br />

