Hi,
I am unable to check the checkboxes with database values.
My table stores the data in below format. I want that when i load the form "useraccess.php" it check the access allowed ealier to the logged user and check the check boxes accordingly.
uid = 1
allowaccess = New User
url = newuser.php
-----------
uid = 1
allowaccess = New Product
url = New Product.php
-----------
uid = 2
allowaccess = New User
url = newuser.php
I tried this code but unable to get desired result.
1st method
<input type="checkbox" id="chk[]" name="chk[]" value="New User" <?php if ($access['allowaccess'] =='New User') echo 'checked="checked"'; ?>/>New User
---------------------
2nd method
<input type="checkbox" id="chk[]" name="chk[]" value="New Product" <?php if($access['allowaccess']=='New Product') {?> checked="checked" <?php }?>/>New Product