Skip to main content
Topic: Server error 500 Checkbox as Single switch (Read 2069 times) previous topic - next topic

Server error 500 Checkbox as Single switch

I have a MySql database with Tinyint(1) for checkbox fields.
When i put in the field properties of the checkbox as "Single Switch", it gives me an error internal 500. ( Error Processing Request)
So i can't add or edit any record.

Please advise.

Thanks

Re: Server error 500 Checkbox as Single switch

Reply #1
Hi Grou,

Thanks for the update. can you provide us with more detail of this error.
 I would suggest if you can change the Tinyint to any other format to see if it works.

Also if you can share screenshot of your browser console.

Thanks for your support.

Re: Server error 500 Checkbox as Single switch

Reply #2
Hi Emman...
After several tests in a separate table, the checkbox as "Single Switch" only works when the datatype field is varchar with a minimum size as 4. So it stores the word "true" when the checkbox is checked and "" when checkbox is false.
(no matter if you change the values of checkedvalue or uncheckedvalue)
It don't make sense, but it was the only way i found to workaround this problem.

If you know another way, please tell me... i want to use the "single switch" because of its professional look and graphical appearance as tinyint (1). 0 for false and 1 for true.

Regards.


Re: Server error 500 Checkbox as Single switch

Reply #3
The problem still exists (PHPRad 2.7.3, PHP 7.4.6, MariaDB 10.4).

 

Re: Server error 500 Checkbox as Single switch

Reply #4
@machobymb‍ please note that the database stores true/false as 1/0 respectively when using a type of tinyint(1) and the value for phprad CheckedValue and UnCheckedValue is a string. The ways you can circumvent the issue is by intercepting the value before inserting and converting it to boolean or int (1 or 0) value.