Error 500 with checkbox and SingleSwitch using 0 and 1 values April 26, 2021, 01:12:40 PM Hello all, I can't make it work using a Checkbox and SingleSwitch option using values different than 'true' and 'false'.I have a field that should be 0 or 1.If I set the field as Checkbox and set is as SingleSwitch, setting CheckValue to 1 and UnCheckValue to 0 I get error 500:SQLSTATE[22007]: Invalid datetime format: 1366 Incorrect integer value: 'false' for column `my_db`.`stores`.`approved` at row 1Please note the 'false' value in the error. Where it is coming from?Is this a bug?As a workaround I've set this field as SELECT.TIAtony Quote Selected
Re: Error 500 with checkbox and SingleSwitch using 0 and 1 values Reply #1 – April 26, 2021, 01:37:54 PM @sweetman The best solution to avoid any error is to set the database column to varchar. but from the SQL error you posted, it seems the database field is set to DateTime. Quote Selected
[SOLVED] Re: Error 500 with checkbox and SingleSwitch using 0 and 1 values Reply #2 – April 26, 2021, 01:46:55 PM Quote from: willvin – April 26, 2021, 01:37:54 PM@sweetman The best solution to avoid any error is to set the database column to varchar. but from the SQL error you posted, it seems the database field is set to DateTime.Hello Willvin,in the db the field is set to INT, actually.Changing the fieldtype to varchar seems to solve the problem.Thanks for your help.Tony Quote Selected