Wie seletiere ich datensätze wo das alter älter als x Jahre ist?
MySQL select * where Geburtstag (type date) > 23 ??
Einklappen
X
-
schaue mal hier vorbei...
EN: http://www.mysql.com/doc/en/Date_calculations.html
DE: http://www.mysql.com/doc/de/Date_calculations.htmlINFO: Erst suchen, dann posten![color=red] | [/color]MANUAL(s): PHP | MySQL | HTML/JS/CSS[color=red] | [/color]NICE: GNOME Do | TESTS: Gästebuch[color=red] | [/color]IM: Jabber.org |

-
Hab jetzt was zusammen geschustert, haut aber nicht so ganz hin...
Kann mir jmd helfen?
$jahre = "24";
$jahredif = date("Y-m-d", strtotime("now - $jahre")); *
$listquery = "SELECT p_id, p_age, p_name, p_plz, p_ort FROM profiles WHERE p_age < '".$jahredif."' ORDER BY p_plz";
* = LINE 25
Ausgabe:
Warning: date() [function.date]: Windows does not support dates prior to midnight (00:00:00), January 1, 1970 in d:\test\inc\list.inc.php on line 25
Ändere ich nun Jahre auf 23, zeigt er mir BEIDE datensaätze (Alter: 23 und 26 Jahre) an...
Kommentar

Kommentar