Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Incorrect Integer (2147483647) is inserted into MySQL?

Alright, so I've been toying around with the Steam Web API, I have one of the values stored in a variable called $steam64. When I use this code snipper to INSERT it into a mysql database it insert a completley different integer than what is stored in the variable.

$sql_query = "INSERT INTO users_info (steam64) VALUES ('$steam64')";

var_dump($steam64); returns the real int, so does echoing it. Not too sure what is going on here, any help is appreciated.

like image 585
Archey Avatar asked Apr 21 '12 02:04

Archey


1 Answers

2147483647 is the largest int value for mysql. Just change the type from int to bigint.

like image 127
George Avatar answered Oct 09 '22 19:10

George