将日期与日和月比较显示错误输出

I want to compare, whether a date is bigger then the current date. With day and month!

If I only compare to month i got this output, which is correct:

Chichiri : 08.11.2014 Rokno2h : 14.11.2014 Sasch79_AUT : 29.11.2014 Sonny : 08.12.2014 Marek : 31.12.2014 Fuchs : 31.12.2014 hauni89 : 31.12.2014 RIX1287 : 31.12.2014

But I want to compare to day and month, so that the first two doen't appear in the list, because their birthdays are over. But I got the following output then:

haislpunk : 29.03.2014 Vastl : 19.04.2014 Luckypunch10 : 22.04.2014 DaveMetz : 25.04.2014 Ghoost : 24.06.2014 RoxoriO_AUT : 18.08.2014 Alchemagi : 21.08.2014 Shizophren83 : 29.08.2014 FatePhoenix : 29.09.2014 Testaccount : 21.10.2014 wernoid : 23.10.2014 bAc-Maus : 25.10.2014 Ginibal : 25.10.2014 CrySix1992 : 28.10.2014 Sasch79_AUT : 29.11.2014 Marek : 31.12.2014 Fuchs : 31.12.2014 hauni89 : 31.12.2014 RIX1287 : 31.12.2014

Here is my code with date('d.m') which doesn't work. With date ('m') is worked with month:

    while($row = mysql_fetch_array($test_result)){
    $curr_date = date('d.m');   
    $date = $row['value'];
    $dateFormatted = date('d.m', strtotime($date));
    //echo $dateFormatted . ' *** ' . $curr_date . '<br>';
    //wenn Geburtsmonat > aktueller Monat dann anzeigen! sonst nicht!
    if($dateFormatted >= $curr_date){
        echo $row['username'] . ' : ';
        echo date('d.m.', strtotime($date)) . date('Y');
        echo '<br />'; 

    }
}

I have to convert the date from database, because it is saved as a text type in the database. I solved this problem in this related question. Mysql Text to Date won't work

Wrong comparison, should compare in format 'm.d', not 'd.m' (you compare strings).

You need to use date object and convert the string to date format with date_create function. Here is the working function for this case:

public  function cmpDates($date1, $date2)
    {
        $date1 = date_create($date1);
        $date2 = date_create($date2);

        $diff = date_diff($date1, $date2);
        return $diff;
     }