SQL Date format for credit card

By gavinjinks ·
Hi There, I am very new to MySQL and am creating a database for online payments etc. What datatype do I need to use for the credit card expiry date?

If i put in the DATE/TIME syntax then it comes up DDMMYYYY. I need to end up having MM/YY only and validated.

Could any one help me please?

Thanks in advance.

This conversation is currently closed to new comments.

4 total posts (Page 1 of 1)  
Thread display: Collapse - | Expand +

All Answers

Collapse -

Well it isn't a date in that format so...

by Tony Hopkinson In reply to SQL Date format for credi ...

As far as I know at least in the UK it's the last day of the month.
Store it as that, then display as MM/YY with a format command.
Data entry your options will depends on what you use, a standard calendar control and then just force the selection to the end of the month is one way.
Spinedit, drop down list, edit box and then check for 1 - 12 etc...

Storing it as something other than a date would simply move the messing about particular when checking to see if the card had expired, don't see much use in that.

Collapse -

ok pplication regulations.

by IT.vgomez In reply to SQL Date format for credi ...

if it's a personal business account either is yours or a company you want to provide CC options too. first is what type of OS are you using. is your a application PCI complaint and can you provide a personal level security that any other pci complaint software or hareware is going to be willing to take the risk.

Collapse -

In a nut shell...

by gavinjinks In reply to ok pplication regulations ...

It's an example I'm nocking up for a University assignment,although the idea is to take our database into the next semester and possibly use it online then.

Collapse -

if using tony's idea doesnt work

by brian In reply to SQL Date format for credi ...

when the cx puts the card mm/yy in split it on the / and add dd/ setting dd to 01 to satisfy the field. When pulling it out, you will have a mm/dd/yy format, split it on the / and then put in the corrosponding mm/yy variables and add a / inbetween (not the best way to do it, but...what ever works sometimes lol).

Back to Web Development Forum
4 total posts (Page 1 of 1)  

Related Discussions

Related Forums