Jump to content


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
  • 4916 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