Código:
<?php function lafecha() { $fecha=getdate(); $mes=$fecha["mon"]; $meses[1]='enero'; $meses[2]='febrero'; $meses[3]='marzo'; $meses[4]='abril'; $meses[5]='mayo'; $meses[6]='junio'; $meses[7]='julio'; $meses[8]='agosto'; $meses[9]='septiembre'; $meses[10]='octubre'; $meses[11]='noviembre'; $meses[12]='diciembre'; $mesactual="$meses[$mes]"; } $elmes=lafecha(); $db=mysql_connect("localhost","root",""); mysql_select_db("hospital1",$db); $sql="SELECT * FROM $elmes ORDER BY dia"; $result=mysql_query($sql); if ($myrow=mysql_fetch_array($result)){ echo "<table border=0 cellpadding=3 cellspacing=1 width=80%>\n"; do { echo "<tr><td bgcolor='#ffffff' width='10%' class='enlace' rowspan='2'><table cellpadding='0' cellspacing='0'><tr><td bgcolor='#E83625'><center><font color='white'><b>".$myrow["dia"]."</b></font></center></td><td bgcolor='#E83625' width='2%' class='enlace' rowspan='2' valign='right'><img src='img/pesta.jpg'></td></tr></table></td>\n"; echo "<td bgcolor='#CAE3F4' height='15' width='20%' class='estilo5'>".$myrow["nombre_1"]."</td><td width='20%' height='15' bgcolor='#CAE3F4' class='estilo5'>".$myrow["nombre_2"]."</td><td bgcolor='#CAE3F4' height='15' width='20%' class='estilo5'>".$myrow["nombre_3"]."</td><td width='20%' height='15' bgcolor='#CAE3F4' class='estilo5'>".$myrow["nombre_4"]."</td></tr>\n"; echo "<tr><td bgcolor='#00A0DC' height='15' width='20%' class='estilo2'>".$myrow["laboratorio"]."</td><td width='20%' height='15' bgcolor='#00A0DC' class='estilo2'>".$myrow["laboratorio_2"]."</td><td bgcolor='#00A0DC' height='15' width='20%' class='estilo2'>".$myrow["laboratorio_3"]."</td><td width='20%' height='15' bgcolor='#00A0DC' class='estilo2'>".$myrow["laboratorio_4"]."</td></tr>\n"; echo "<tr><td bgcolor='white' colspan=5 width='100%' class='estilo5'></td></tr>\n"; } while($myrow=mysql_fetch_array($result)); echo "</table>\n"; } else { echo "No Se Encontraron Resultados Para La Busqueda!\n"; } ?>