I am trying to set the value of my checkbox. I do have a SQLite database with a table with some rows. Some rows contain STATUS = 1
, some contain STATUS = 0
.
... "STATUS" BOOL NOT NULL DEFAULT 1, ...
So I check the current row with the fetchArray function and everything else works fine, but in my HTML site, all checkboxes are checked. Is there a logical mistake?
while ($row = $table->fetchArray(SQLITE3_ASSOC))
{
$output .= '<tr>';
if ($row['STATUS'] == 1) {
$output .= '<td class="STATUS" data-id1="' . $row['ID'] . '" bgcolor="#cecece"><input type="checkbox" name="STATUS" checked="true"></td>';
}
else {
$output .= '<td class="STATUS" data-id1="' . $row['ID'] . '" bgcolor="#cecece"><input type="checkbox" name="STATUS" checked="false"></td>';
}
$output .= '<td class="USER" data-id2="' . $row['ID'] . '" contenteditable="true">' . $row['USER'] . '</td>
...
<td class="DESCRIPTION" data-id11="' . $row['ID'] . '" contenteditable="true">' . $row['DESCRIPTION'] . '</td>
<td><button type="button" name="btn_edit" data-id12="' . $row['ID'] . '" class="btn btn-xs btn-warning btn-block btn_edit">Edit</button></td>
<td><button type="button" name="btn_delete" data-id13="' . $row['ID'] . '" class="btn btn-xs btn-danger btn-block btn_delete">Delete</button></td>
</tr>';
}