Jump to content

Archived

This topic is now archived and is closed to further replies.

onlyican

Workout out Birthdays

Recommended Posts

First, on the note of Birthdays
Happy Birthday google, 8 years, they grow up soo fast

Anyway

I store users DOB's in the MySQL table, in Mysql Format (2006-09-27)

WHats the best way to work out whos birthday it is today

I was thinking either
$today = date("m-d");
$query1 = "SELECT * FROM members WHERE dob LIKE '%".$today."' ";
OR
$today = date("m-d");
$query1 = "SELECT * FROM members WHERE dob BETWEEN '1000-".$today."' AND '30-".$today."'";

What do u think
Or any better ideas

Also,

Is there a database I can get Celebs birthdays from
So I can
This persons birthday is also today...

Share this post


Link to post
Share on other sites
as for the individual user b-days, just use this:
[code]
<?php
$day = date('d');
$mon = date('m');
$sql = mysql_query("SELECT username FROM users WHERE MONTH(DOB) = '$mon' AND DAYOFMONTH(DOB) = '$day'");
?>
[/code]

Share this post


Link to post
Share on other sites
Even better is:

[code]<?php
$query1 = mysql_query("select * from members where month(dob) = month(curdate()) and day(dob) = day(curdate())");
?>[/code]

Share this post


Link to post
Share on other sites
Excellent

Now I need to build a database to Famous Disabled people, and there birthdays
Wish me luck

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.