Jump to content

Recommended Posts

Hi there...

 

Okay just a quick shoot....below are my currently table structure(MySql) to store the user birthday date

 

idbirthday    |    name        |  birthdaydate

--------------------------------------------------

      0        | user 9          | 22-05-2007             

      1        | user8          | 01-05-2007   

      2        | user4          | 21-07-2007             

      3        | user2          | 05-05-2007 

 

So how to setup a mysql_query so that I can only print the record which is within current month eg;current month "MAY"..so the correct output will be 3 record...so I really need help on it....any help are appreciated....thank

I think you'll find that date/time functions, sorting and comparisons wil not work with that date format.

 

If you want dates in your tables to be useful as dates, and not just as a string of characters, store them correctly in a TYPE DATE column in YYYY-MM-DD format.

 

Currently you have to treat it like any other piece of text

 

... WHERE SUBSTRING(birthdaydate,4,2) = '05'

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.