Skip to main content

How do I define checkboxes in a form?

I have a form where I would like to define checkboxes. But I would like to get their labels and values from database. I would like to set "id" as values where "active" = 1 and "url" as labels from database.

My database table (notifications) looks like this:

id | uid | hash | url | active

How can I achieve this?

asrob
  • 491
  • 1
  • 6
  • 18