get members who have birthday this week [message #174728] |
Wed, 29 June 2011 21:20 |
Co
Messages: 75 Registered: May 2011
Karma: 0
|
Member |
|
|
Hi All,
I want to display all members who have their birthday the coming week.
I tried some code but it doesn't return any records. Probably because
it looks for the date of birth
instead of just the month and day:
$today = date("d-m-Y");
$birthday = $row['birthday'];
$sql = mysql_query("SELECT * FROM myMembers WHERE birthday BETWEEN
$today AND $today+7");
Can anyone help me out here?
Marco
|
|
|
Re: get members who have birthday this week [message #174729 is a reply to message #174728] |
Wed, 29 June 2011 21:29 |
Jerry Stuckle
Messages: 2598 Registered: September 2010
Karma: 0
|
Senior Member |
|
|
On 6/29/2011 5:20 PM, Co wrote:
> Hi All,
>
> I want to display all members who have their birthday the coming week.
> I tried some code but it doesn't return any records. Probably because
> it looks for the date of birth
> instead of just the month and day:
>
> $today = date("d-m-Y");
> $birthday = $row['birthday'];
>
> $sql = mysql_query("SELECT * FROM myMembers WHERE birthday BETWEEN
> $today AND $today+7");
>
> Can anyone help me out here?
>
> Marco
This is a MySQL question, not a PHP one (hint: PHP knows NOTHING about SQL).
I would suggest you ask in comp.databases.mysql.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex(at)attglobal(dot)net
==================
|
|
|
|