Código PHP:
function ShowEfemerids(){
$month = date("m");
$day = date("d");
echo "<table width='225' border='0' cellpadding='0' cellspacing='0'>
<tr>
<td class='menutop'><img src='img/birthday.gif' alt='Efemérides de hoy' width='17' height='20' align='absmiddle'> Efemérides del día de hoy $date </td>
</tr>";
$query = "SELECT * FROM efemerides ORDER BY idefemerides";
$result = mysql_query($query) or die("No se ha podido ejecutar la consulta ".$query.". MySQL ha retornado el siguiente error: ".mysql_error());
while($sql=mysql_fetch_assoc($result)){
$fecha = explode("-", $sql['fecha']);
list($mes,$dia)=$fecha;
if($mes>0 && $mes<10){
$newmes = "0".$mes;
}else{
$newmes = $mes;
}
if($dia>0 && $dia<10){
$newdia = "0".$dia;
}else{
$newdia = $dia;
}
if(($month==$newmes)&&($day==$newdia)){
echo "<tr>
<td>".$sql['titulo']."</td>
</tr>";
}
}
echo "</table>";
}
Salu2