Get enum to show as checkbox in 3 simple steps (v2018)

Tips submitted by PHPMaker users
Post Reply
bobmulder5555
User
Posts: 60

Get enum to show as checkbox in 3 simple steps (v2018)

Post by bobmulder5555 »

First of all: bit(1) and tinyint(1) are not interpreted as booleans by PHPMaker 2018. See viewtopic.php?f=4&t=28288&p=81225&hilit=tinyint+display+checkbox#p81225.
And Bit(1) is not supported as datatype.

The steps:

  1. Define your MySQL enums with values 1 and 0 IN THAT ORDER. So, if you use Navicat to manage your databases, input the 1 first, then 0. You'll get '1', '0' in the values box. Thus True, False. DON'T change this sequence.
    My guess is that PHPMkr otherwise can't interpret it as a boolean, as enum can take more than 2 values.
    And it needs to decide it's a boolean, otherwise you can't have your checkboxes.

  2. Make sure the edit tag in PHPMkr has the checkbox selected

  3. Rightclick your table in PHPMkr's database window and sync with your database. Or do an overall sync. I'm assuming here that you already have everything set up and working EXCEPT for your checkboxes.
    PHPMaker will have (re)populated your enum fields with value 1, label 1 and value 0, label 0. Just leave it be. Don't tinker.

And that's it.
Your glorious checkboxes are working (again)!


Post Reply