I am in the process of creating a simple web application to track visitors to a church. I have created the form that is used to add visitors to the database and am using several check boxes for yes/no answers as per below which works perfectly and enters either yes or no to the db depending on the status of the checkbox.
<input type="hidden" value="no" name="relationship">
<input type="checkbox" value ="yes" name="relationship">
Now, here is where I'm having an issue. I have been asked to add in the ability for the administrator to be able to update the records using a similar form layout. I have managed to get the text boxes to pull the existing from the database by using code like below.
First Name: <input type="text" name="first_name" id="first_name" value="<?php echo $visitor_data['first_name'], ' '; ?>">
However, how can I do the same for a checkbox? I have searched here and can not find anything about it. Greatly appreciate your time.