Yahoo
Yahoo

Reputation: 4187

MYSQL inserting wrong info

I am inserting value

insert into user (name,fbid) Values ('Adi Mathur',100000564553314)

but in the database i see the value if fbid to be

2147483647

Why ? How should i fix it ?

fbid int(50)

Upvotes: 0

Views: 60

Answers (1)

eggyal
eggyal

Reputation: 125855

As explained in the manual, the maximum value of a (signed) INT, which occupies 4 bytes/32 bits, is 2,147,483,647; for integer data types, the number in parenthesis is the display width, which only affects the way that the data is displayed, not how much space it is allocated for storage:

M indicates the maximum display width for integer types. For floating-point and fixed-point types, M is the total number of digits that can be stored (the precision). For string types, M is the maximum length. The maximum permissible value of M depends on the data type.

You probably want a BIGINT.

Upvotes: 3

Related Questions