2
<?php
header("Content-type: text/xml");
echo'<?xml version=\'1.0\' encoding=\'UTF-8\'?>';
echo' <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">';
include 'conexao.php';
include 'acoes.php';
$sql = mysql_query("select nome, nota from aluno");
while ($string = mysql_fetch_array($sql)){?>
<url>
<loc>http://www.escola.com.br/<?echo removerosAcentos($string['nome']);?>/<?echo $string['nota'];?></loc>
<changefreq>weekly</changefreq>
</url>
<?php } ?>
</urlset>
This code generates a sitemap (pulling from the database)
I need to generate a sitemap with 45 thousand (sitemap1.xml) and after reaching the 45 thousand results another sitemap (sitemap2.xml) and so on.
There is a column with the name "number" (Ex: 054322123) that can be used to sort. I have no idea how to do this. Can anyone help me in detail? I appreciate!
Anthraxisbr, How would I look in my code above (I really don’t have much sense) And how would I be created automatically? sitemap1.xml sitemap2.xml etc? Can you detail more? Thank you.
– Marcelo
Take a look at the response update, now you should be able to do this
– AnthraxisBR
I’m trying to mount on top of your code. So far nothing, in case you get put here the solution! Thanks!
– Marcelo