Jump to content

unsigned character type


simpli

Recommended Posts

Hi all,

I have a primary key field that I designed as an unsigned, auto-increment integer. I did that because I figure I would get a wider range of number without needing a bigger data type. When I'm in phpMyadmin however, if I am adding a row of data directly on my table and I click on that field I have a drop down list where I have a negative AND a positive version of whatever number happens to already be in my table. For instance if in my table I had rows with the ids 40, 41 and 42, in the dropdown menu I would have choices of -40, -41, -42, 40, 41, 42. I find this a weird behaviour and I am now wondering if I did well to go with an unsigned type. Should I just stick with a double or a plain integer?

 

Is my reasoning that an unsigned int would give me more numbers for the same space wrong?

 

Thanks for clarifying.

JR

Link to comment
https://forums.phpfreaks.com/topic/166258-unsigned-character-type/
Share on other sites

What it actually does ( I just found out) is give me a choice from the table I am linked through referential integrity. It is in this table that the ids are 40, and 41. I guess it's giving me then the choice to enter -40,-41, 40 and 41 as they are equal the unsigned value. I'm just not sure I understand why. If the type is unsigned, shouldn't I just have 40 and 41?

Thanks

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.