Get day and month part from date [message #174731] |
Thu, 30 June 2011 08:21 |
Co
Messages: 75 Registered: May 2011
Karma: 0
|
Member |
|
|
Hi All,
I would like to retrieve people's birthday from the database.
But only those who celebrate the coming week.
SELECT * FROM members WHERE birthday BETWEEN $today AND $today+7
The birthday field holds also the year but I just need day and month.
Is there a way to do this?
Marco
|
|
|
Re: Get day and month part from date [message #174732 is a reply to message #174731] |
Thu, 30 June 2011 11:16 |
Jerry Stuckle
Messages: 2598 Registered: September 2010
Karma: 0
|
Senior Member |
|
|
On 6/30/2011 4:21 AM, Co wrote:
> Hi All,
>
> I would like to retrieve people's birthday from the database.
> But only those who celebrate the coming week.
>
> SELECT * FROM members WHERE birthday BETWEEN $today AND $today+7
>
>
> The birthday field holds also the year but I just need day and month.
> Is there a way to do this?
>
> Marco
Like I told you yesterday - this is not a PHP question. Try an
appropriate newsgroup, such as comp.databases.mysql.
Ask in the right place and you'll get a good answer.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex(at)attglobal(dot)net
==================
|
|
|
Re: Get day and month part from date [message #174733 is a reply to message #174732] |
Thu, 30 June 2011 12:13 |
me
Messages: 192 Registered: September 2010
Karma: 0
|
Senior Member |
|
|
On 6/30/2011 7:16 AM, Jerry Stuckle wrote:
> On 6/30/2011 4:21 AM, Co wrote:
>> Hi All,
>>
>> I would like to retrieve people's birthday from the database.
>> But only those who celebrate the coming week.
>>
>> SELECT * FROM members WHERE birthday BETWEEN $today AND $today+7
>>
>>
>> The birthday field holds also the year but I just need day and month.
>> Is there a way to do this?
>>
>> Marco
>
> Like I told you yesterday - this is not a PHP question. Try an
> appropriate newsgroup, such as comp.databases.mysql.
>
> Ask in the right place and you'll get a good answer.
The best help for forming the query is indeed in the mysql newsgroup.
Insofar as incorporating the query into your PHP code,
http://www.php.net/manual/en/ref.mysql.php may be helpful. The related
pages have many query examples that may be useful to you.
Bill B
|
|
|
|
Re: Get day and month part from date [message #174740 is a reply to message #174731] |
Fri, 01 July 2011 10:29 |
Captain Paralytic
Messages: 204 Registered: September 2010
Karma: 0
|
Senior Member |
|
|
On Jun 30, 9:21 am, Co <vonclausow...@gmail.com> wrote:
> Hi All,
>
> I would like to retrieve people's birthday from the database.
> But only those who celebrate the coming week.
>
> SELECT * FROM members WHERE birthday BETWEEN $today AND $today+7
>
> The birthday field holds also the year but I just need day and month.
> Is there a way to do this?
>
> Marco
It doesn't matter how many times you ask this question, it will still
remain a MySQL question and not a php one.
One general hint is that if you want to invent your own syntax, you
will need to build your own programming language. If you wish to use
the MySQL programming language then you must stick to the syntax as
published in its manual.
|
|
|
Re: Get day and month part from date [message #174750 is a reply to message #174740] |
Sun, 03 July 2011 15:20 |
Co
Messages: 75 Registered: May 2011
Karma: 0
|
Member |
|
|
On 1 jul, 12:29, Captain Paralytic <paul_laut...@yahoo.com> wrote:
> On Jun 30, 9:21 am, Co <vonclausow...@gmail.com> wrote:
>
>> Hi All,
>
>> I would like to retrieve people's birthday from the database.
>> But only those who celebrate the coming week.
>
>> SELECT * FROM members WHERE birthday BETWEEN $today AND $today+7
>
>> The birthday field holds also the year but I just need day and month.
>> Is there a way to do this?
>
>> Marco
>
> It doesn't matter how many times you ask this question, it will still
> remain a MySQL question and not a php one.
>
> One general hint is that if you want to invent your own syntax, you
> will need to build your own programming language. If you wish to use
> the MySQL programming language then you must stick to the syntax as
> published in its manual.
I get the point guys.
I just thought there might be a PHP solution instead of editing the
query.
Marco
|
|
|