antes de leer lo que me has puesto marvin lo he solucionado:
tambien pongo el codigo:
Código PHP:
$texto="<gallery title=\"Navdeeps Gallery\" thumbDir=\"img/galeria/thumb/\" imageDir=\"img/galeria/\" random=\"False\">\n";
$maximcat="SELECT Max(id) FROM xmlcategories";
$maximcat=mysql_query($maximcat);
$maximcat=mysql_result($maximcat,0,0);
for ($i = 1; $i <= $maximcat; $i++){
$nomcat="SELECT name FROM xmlcategories WHERE id='$i'";
$nomcat=mysql_query($nomcat);
$nomcat=mysql_result($nomcat,0,0);
$basename="SELECT dbase FROM xmlcategories WHERE id='$i'";
$basename=mysql_query($basename);
$basename=mysql_result($basename,0,0);
$nomcat=ereg_replace("ñ","n",$nomcat);
$texto.="<category name=\"$nomcat\">\n";
$maximimg="SELECT Max(id) FROM $basename";
$maximimg=mysql_query($maximimg);
$maximimg=mysql_result($maximimg,0,0);
for ($x = 1; $x <= $maximimg; $x++){
$texto.="<image>\n";
$datosdate="SELECT date FROM $basename WHERE id='$x'";
$datosdate=mysql_query($datosdate);
$datosdate=mysql_result($datosdate,0,0);
$datostitle="SELECT title FROM $basename WHERE id='$x'";
$datostitle=mysql_query($datostitle);
$datostitle=mysql_result($datostitle,0,0);
$datosthumb="SELECT thumb FROM $basename WHERE id='$x'";
$datosthumb=mysql_query($datosthumb);
$datosthumb=mysql_result($datosthumb,0,0);
$datosimg="SELECT thumb FROM $basename WHERE id='$x'";
$datosimg=mysql_query($datosimg);
$datosimg=mysql_result($datosimg,0,0);
$texto.="<date>$datosdate</date>\n";
$texto.="<title>$datostitle</title>\n";
$texto.="<desc>$datostitle</desc>\n";
$texto.="<thumb>$datosthumb</thumb>\n";
$texto.="<img>$datosimg</img>\n";
$texto.="</image>\n";
}
$texto.="</category>\n";
}
$texto.="</gallery>\n";
//echo $texto;
$name_file="gallery_micropixel.xml";
$file=fopen($name_file,"w+");
fwrite ($file,$texto);
fclose($file);
}
gracias de todas formasss