Jump to content

Column Text Value Issue


scott botkins

Recommended Posts

I've created a database for data to be stored. Each one is stored by an id such as 000001 for the first one. However when I run the search on a internet browser and type in the 000001 it shows up as just "1" instead of "000001" so I'm guessing I have the attributes wrong in database. In phpmyadmin for the field id I have it set for TEXT and not null, do you know what it should be set to fix this error? Thanks!

Link to comment
Share on other sites

I've created a database for data to be stored. Each one is stored by an id such as 000001 for the first one. However when I run the search on a internet browser and type in the 000001 it shows up as just "1" instead of "000001" so I'm guessing I have the attributes wrong in database. In phpmyadmin for the field id I have it set for TEXT and not null, do you know what it should be set to fix this error? Thanks!

 

1) Why do you care how the DB stores this?

2) It should never be TEXT, but rather UNSIGNED INT.

3) If you really care (and you don't) you can use ZEROFILL.

4) You can make it as pretty as you like on the  way out, don't mess up the internal DB storage.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.