Search code examples
phpmysqlrangeauto-increment

Out of Range value adjusted for column 'id' at row 1


I just uploaded my website on my server and im facing a problem in inserting the data into MySQL table.

I echoed mysql_error and I get the following:

Out of range value adjusted for column 'id' at row 1.

ID is an auto_increment value (INT(11)) and my query is as follows:

INSERT INTO table (id,x,x) VALUES ('','$x','$x')

I cant figure out what to do. Any ideas ?


Solution

  • Try to set NULL. it will take auto increment value for id column.

    Example

    INSERT INTO table (id,x,x) VALUES (NULL,'$x','$x');