ich bin kein spezialist.
von welchem typ ist `birth_date`? was sagt mysql_error()?
von welchem typ ist `birth_date`? was sagt mysql_error()?
SELECT username, DAYOFMONTH(`birth_date`)
FROM `osdate_user`
WHERE DAYOFMONTH(`birth_date`) = DAYOFMONTH (NOW())
ORDER BY `birth_date` ASC
<?php
$db= mysql_connect("localhost", "xxxx","mxxxx")
or die ("Keine Verbindung moeglich");
mysql_select_db("dates")
or die ("Die Datenbank existiert nicht");
$sql = 'SELECT username, DAYOFMONTH(`birth_date`)'
. ' FROM `osdate_user`'
. ' WHERE DAYOFMONTH(`birth_date`) = DAYOFMONTH (NOW())'
. ' ORDER BY `birth_date` ASC LIMIT 0, 30 ';
$result = mysql_query($sql,$db);
while($line=mysql_fetch_assoc($result))
{
echo $line['birth_date']."-".$line['username']. "<br>";
}
echo $line;
?>
<?php
$db= mysql_connect("localhost", "datesadmin","munich4dates")
or die ("Keine Verbindung moeglich");
mysql_select_db("dates")
or die ("Die Datenbank existiert nicht");
$tag = date (d);
$sql = 'SELECT username, DAYOFMONTH(`birth_date`)'
. ' FROM `osdate_user`'
. ' WHERE DAYOFMONTH(`birth_date`) = DATE_FORMAT(NOW(), \'%e\')'
. ' ORDER BY `birth_date` ASC LIMIT 0, 30 ';
$result = mysql_query($sql,$db);
$num_rows = mysql_num_rows($result);
while($line=mysql_fetch_assoc($result))
{
echo $line['birth_date']. "<br>". $line['username'];
}
echo "<br>". "$num_rows Rows\n";
?>
Kommentar