hello, im trying to use the Simpcms news script for my php page. but when the addons is installed etc i get this error "Out of range value adjusted for column 'id' at row 1" when trying to post anyting and was told it's my mysql side's problem and wonder if anyone knowwhy i could get this error ?
Can you find the query that threw this error? I had a similar problem when installing an IPB once. It turned out that i had to change the STRICT_MODE settings to make the script working. The query that caused the error tried to insert an empty value in the id field, and when STRICT_MODE_ALL is enabled mysql will throw an error as it expects an integer (or preferrable nothing, if auto_increment is active on that field)
I have this problem also. When I installed mysql on my XP box, the default was strict, so I left it. Should I have unchecked it? I cannot insert anything into a table because when I leave the id field (auto_increment) blank, I get an error. Ex: insert into table_name values ('', 'text'); Where the first empty field as denoted by the apostrophes, is empty, and where 'text' is be inserted into a varchar field. When I put a number in the first field, then it works. Weird.
okay, setting mysql to not strict fixes the problem, but I assume there's a reason the default is set to strict. So, how should I insert data into a table with an auto_increment field (in strict mode)?
Found the answer on another forum: Just use NULL instead of the empty '' set. Hope this helps someone else out.
Careful with NULL. If you ever want to group by that field you will find your self missing records. You should set it to another value other then NULL so you can always group by it if needed.
I would use something else if I knew what to use when in strict mode other than NULL when using auto_increment.