MySQL Integers with '0' at begining

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
User avatar
kendall
Forum Regular
Posts: 852
Joined: Tue Jul 30, 2002 10:21 am
Location: Trinidad, West Indies
Contact:

MySQL Integers with '0' at begining

Post by kendall »

Hello,

Whats data type should i use when entering data type that would allow integers with 0 at the begining??

Kendall
User avatar
Stoker
Forum Regular
Posts: 782
Joined: Thu Jan 23, 2003 9:45 pm
Location: SWNY
Contact:

Post by Stoker »

an integer as a type does not contain leading zeroes as it is an n+ bit single whole number. Such would be at the presentation level. If for some odd reason you need to store such it must be as a string or binary type (E.g. Character Varying), likely to use more storage space than a fit-size integer...
Post Reply