PHP dynamic checkboxes
问题 I'd like to display all roles from database as check-boxes and check the ones that the current user is already in. Question: How can I check the check-boxes where the user is already in that role. <?php // DB QUERY: get role names // ------------------------------------------------------------------ $get_roles = mysqli_query($conn, "SELECT RoleName FROM roles") or die($dataaccess_error); $get_user_in_roles = mysqli_query($conn, "SELECT RoleName FROM users_in_roles WHERE UserId = $user_id") or