I have some registers in a mysql DB of diferent months and years and want to show them in months to do an agenda of events, or either, have the easiness to change the month and see their registers.
How can I do this??
This code only serves for the present monthPHP Code:<?
$sql = "select * from agenda_geral where agenda='Desporto' and month=MONTH(now()) and area_ID = 1 order by day" ;
$queryl = query($sql);
$contal = mysql_num_rows($queryl);
for ($j=0; $j<$contal;$j++)
{
$arrl = mysql_fetch_array($queryl);
?>
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr class="back05">
<td>
<h5><? echo $arrl["day"]." de ".trata_month($arrl["month"]); ?></h5>
</td>
<td width="15"><img src="images/icon-top0.gif" width="15" height="15" alt="" /></td>
<td width="100"><a href="#top">Topo da Página</a></td>
</tr>
</table>
<h2 class="padded"><? echo $arrl["titulo_geral"]; ?></h2>
<h3 class="padded"><br />
<span class="style8"><? echo $arrl["comentario"]; ?></span>
</h3>
<p class="foto"><? if($arrl["foto"]!= NULL) {?><img src="../2.0/admin/<? echo $arrl["foto"]; ?>" alt="Cartaz do Evento" width="100" height="151" border="0" /><? } ?></p>
<p class="padded"><span class="des01"><? echo $arrl["item1"]; ?></span> <? echo $arrl["desc_item1"]; ?><br />
<span class="des01"><? echo $arrl["item2"]; ?></span> <? echo $arrl["desc_item2"]; ?><br />
<span class="des01"><? echo $arrl["item3"]; ?></span> <? echo $arrl["desc_item3"]; ?><br />
<span class="des01"><? echo $arrl["item4"]; ?></span> <? echo $arrl["desc_item4"]; ?><br />
<span class="des01"><? echo $arrl["item5"]; ?></span> <? echo $arrl["desc_item5"]; ?><br />
<span class="des01"><? echo $arrl["item6"]; ?></span> <? echo $arrl["desc_item6"]; ?><br />
<p><? if($arrl["site"]!= NULL) {?><img src="images/arrow01.gif" alt="" width="8" height="6" border="0" /> <a href="<? echo $arrl["site"]; ?>" target="_blank"><? echo $arrl["site_text"]; ?></a><? } ?><br />
<? if($arrl["email"]!= NULL) {?><a href="mailto:<? echo $arrl["email"]; ?>"><span class="pquoted"><img src="images/ico_email.gif" alt="" width="14" height="10" border="0" /></span> <? echo $arrl["email_text"]; ?></a> <? } ?></p>
<p class="end"></p>
<p><span class="des01"><? echo $arrl["titulo_prog"]; ?></span></p>
<p class="padded"> <? echo $arrl["desc_prog"]; ?></p>
<? } ?>



Reply With Quote
Bookmarks