Thanks for your help, but I am still struggling.
I can see the values inserted in the database as 1 and 0, if the checkbox is checked or unchecked respectively.
I can also see the values retrieved from the database as 1 or 0 when I go to edit page again.
The problem is: based on the values it is not checking or unchecking the box for values retrieved from the database.
How can check the box if the value is 1 and uncheck otherwise. I have tried using 'checked' outside of value attribute, it works but then it is checked for every value.
Any clue ?
Code:
<input type="checkbox" name="archive" value="<? if($p['archive']==1) print 'checked'; else print 'unchecked'?>" ><?=$p['archive']?></input>
The source code of page for uncheck is:
Code:
<input type="checkbox" name="archive" value="unchecked" />0
and the source code of page for check is:
Code:
<input type="checkbox" name="archive" value="checked" />1