I have the next code:
function trata_month($mes) {
$months = array("", "Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro");
return $months[$mes];
}
[PHP]
<?
$conn = mysql_connect(SERVER,DBUSER,DBPWD) or die ("Problemas na ligação MySQL");
mysql_select_db (DB);
$modifier = isset($_GET['modifier']) ? mysql_real_escape_string($_GET['modifier'], $conn) : 0;
$sql = "select * from agenda_geral where agenda='desporto' and month = month(now()) + ".$modifier." and area_ID = 1 order by day" ;
$queryl = query($sql) or die ("Query failed: " . mysql_error() . " Actual query: " . $sql);
$contal = mysql_num_rows($queryl);
.......
<p>
<?php for($i=-3;$i<2;$i++) { ?>
<a href="agend_desporto.php?modifier=<?php echo($i); ?>"><?php echo(trata_month($arrl["month"]+$i)); ?></a><br />
<?php } ?>
</p>[/PHP]
Resume output:
http://10.0.0.9/cm-lousa.pt/2.0/agen...php?modifier=0
Fevereiro
Março
Abril
Maio
Junho
http://10.0.0.9/cm-lousa.pt/2.0/agen...hp?modifier=-1
Janeiro
Fevereiro
Março
Abril
Maio
In this case, if I click in Abril, it goes to Maio
If i click in Fevereiro, it goes to Março and shows:
Janeiro
Fevereiro
Março
Abril
and so on.
Did you understand the problem?!!