I have a form where I need to add a checkboxes field. The purpose of this form is to display some values from the database. I would like to display _id_ from my database table as checkbox' value (when `"active" = 1`) and _url_ as checkbox' labels.

The database table's structure is the following.

    id | uid | hash          | url          | active

    1  | 1   | myhashstring1 | example_url  | 1
    2  | 1   | myhashstring3 | example_url4 | 1
    3  | 1   | myhashstring2 | example_url2 | 0

How can I achieve this?