Question Locked

SQL Date format for credit card

0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

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.

5 replies

by tony hopkinson

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.

by it.vgomez

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.

by gavinjinks

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.

by brian

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).

This discussion is closed to new replies.