gehe zu (Forum auswahl)
Code: Alles auswählen
<?php
define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
$userdata = session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
$sql = "SELECT
user_id,
username,
user_planet,
user_geb,
date_format(user_geb,'%d.%m.%Y') AS datum
FROM
board_users
WHERE
date_format(user_geb,'%m.%d') >= date_format(curdate(),'%m.%d')
ORDER BY
dayofmonth(user_geb)
LIMIT 20";
$result = mysql_query($sql) OR die(mysql_error());
?>
<table width="44%" border="0" align="center">
<tr>
<td width="35" height="24"><div align="center"><strong>#</strong></div></td>
<td width="108" height="24"><div align="center"><strong>Benutzername</strong></div></td>
<td width="143" height="24"><div align="center"><strong>Planet</strong></div></td>
<td width="123" height="24"><div align="center"><strong>Geburtstagsdatum</strong></div></td>
</tr>
<?php
while($row = mysql_fetch_assoc($result))
{
?>
<tr>
<td width="35" height="24" align="center"><?php echo $row['user_id']. "\n";?> </td>
<td width="108" height="24" align="center"><?php echo $row['username']. "\n";?></td>
<td width="143" height="24" align="center"><?php echo $row['user_planet']. "\n";?></td>
<td width="123" height="24" align="center"><?php echo $row['datum']. "\n";?></td>
</tr>
<?php
}
?>
</table>
<?php
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
?>
Bei dayofmonth() musst du auch noch month() davorschreiben (=Zuerst nach Monat und dann nach Jahr sortieren). dayofyear ist (wer hätte es gedacht) tag des jahres und funktioneirt erst ab MySQL 4.1.1. Hättest du aber auch unter http://www.mysql.com/doc/en/Date_and_ti ... tions.html selbst nachlesen können.
füge die dayofyear() bzw. month() und dayofmonth() zusätzlich unter SELECT ein und vergleiche sie mit der Ausgabe von date("z") bzw. date("n") und date("j"): http://de.php.net/manual/de/function.date.php