Jump to content

The forums are in maintenance (read-only) mode until further notice. If you search these forums, you may find the answer you need. Otherwise, Google and Stack Overflow are reliable resources; arguably faster ones, too. I apologize for any inconvenience. (For those concerned--and thanks for being so thoughtful, there's no cause for alarm, but after 12+ years running these forums in my "spare time", I'm opting for a much deserved break to recharge my depleted batteries.)


Shouldn'T Credit_Card_Number In Orders Table Be String?

  • Please log in to reply
1 reply to this topic

#1 NewEcommerce1



  • Members
  • Pip
  • 4 posts

Posted 7 March 2012 - 6:42 PM

PHP 5.3.6
MySQl 5.5.9
MAMP (for development)

When the last four digits of a credit card number have 0's - because the cc_num is stored as an integer, those zero's are not stored.

In my test account, with Authorize, the test card number's last four digits are 0027. This is stored in the orders table as 27 - as of course it is an integer. Shouldn't it be stored as a string field - like char(4)? That would give a correct "0027" as the last four digits....

  • 0

#2 Larry



  • Administrators
  • 4,399 posts
  • LocationState College, PA (USA)

Posted 7 March 2012 - 8:14 PM

You could store it as a CHAR(4), if you want, or just apply the zerofil property to the integer column.
  • 1