Jump to content

[SOLVED] Un-Signed Field Type


ballouta

Recommended Posts

Hello

 

What is the correct Data Type for a 'credits' field so no + or - is allowed.

For certain logic errors in my code, the credits sometimes are going -2,

I will fix my code but i also want the field to accept only Numbers.

 

Please help

 

thank you

Link to comment
Share on other sites

Have you read the responses at all or even made an attempt to find what the unsigned attribute does in either the PHPMyAdmin or MySQL documentation?

 

 

No offense, but people have told you a few times now.  Unsigned essentially means that numbers cannot be negative.  For example, the range of an unsigned int is 0 to 2^32-1.

 

With a normal integer, 31 bits would be value, and the least significant bit would denote positive or negative.

 

Therefore, a signed int would be -2^31-1 to 2^31-1.

 

 

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.