I would like to check a checkbox if I have integer 1 stored in row a or b.
For now I created a working version to check for row ‘a’.
How can I check also for row ‘b’? So as said above if row a or/and b has integer 1 stored check the checkbox.
<input type="checkbox" name="a" id="a" value="1" <?php if($row['a'] == "1") { echo "checked"; }?>>
2
Answers
This should work for you. this will echo checked to make the checkbox checked if any of the row contains integer 1