a ver si asi jala modifike unas kosas
Código PHP:
include("header.php");
# Creamos el fichero Text.txt y damos permiso de escritura
$f1=fopen("text.txt","w+");
# Escribimos al final del fichero preexistente
$mostrar= Novedades();///le kite las komillas y mando llamar la funcion antes de mandarla escribir
fputs($f1,$mostrar);
function Novedades(){
global $provincia, $dbi;
$result = mysql_query("select * from novedades order by time", $dbi);
WHILE ($row = mysql_fetch_row($result))
$number = mysql_numrows($result);
$i = 0;
$aux="";
WHILE ($i < $number):
$time = mysql_result($result,$i,"time");
$title = mysql_result($result,$i,"title");
if ($i%2 == 0) {
$aux.= "$time - $title <br><br>\n"; ///lo guardo en uan variable auxiliar para ke lo regrese la funcion
} else {
$aux.= "$time - $title <br><br>\n";
}
$i++;
ENDWHILE;
mysql_close();
return $aux;
}
# Para comprobar si obtiene las Novedades lo imprimimos.
// Print Novedades();
#cerramos el fichero
fclose($f1