data with leading zero... (in MySQL)

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
apek
Forum Commoner
Posts: 96
Joined: Tue Jan 06, 2004 11:19 pm
Location: Holiday Plaza Johor Bahru

data with leading zero... (in MySQL)

Post by apek »

what is the data type that allow leading zero???
i try to fill 01,02...but it keeps storing 1,2....
User avatar
mikusan
Forum Contributor
Posts: 247
Joined: Thu May 01, 2003 1:48 pm

Post by mikusan »

Try using strings. And then reformat it, or cast it to whatever.
User avatar
apek
Forum Commoner
Posts: 96
Joined: Tue Jan 06, 2004 11:19 pm
Location: Holiday Plaza Johor Bahru

Post by apek »

theres no STRINGS data type in mysql....
qads
DevNet Resident
Posts: 1199
Joined: Tue Apr 23, 2002 10:02 am
Location: Brisbane

Post by qads »

VARCHAR should do the job.
User avatar
mikusan
Forum Contributor
Posts: 247
Joined: Thu May 01, 2003 1:48 pm

Post by mikusan »

Doh :)
I didn't catch the this is a mysql question hint...
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

I've moved this to Databases. Please take the time to clearly identify what you are asking, post in the relevant forum and also don't post the same problem in a multitude of different places. It'll only get confusing for you and irritating for other users.

Mac
Post Reply