Hello everyone
I am trying to update a table [id - int (11) and status - tinyint(1)] which has four rows using checkboxes with jquery and ajax.
I have manage to do it by dynamically generating the checkboxes. But, now I want to use indiviual checkbox to update each value.

Checkbox generated from loop dynamically

while ($row = $result->fetch_assoc()) {
        ?>
                <label class="switch">
                    <input type="checkbox" id='id[] ' class="check" <?php echo $row['status']==1?'checked':'' ?>  />
                    <span class="slider round"></span>
                </label>

Something like

<form method="post" action="">
<input name="id[]" value="1" type="checkbox" checked=""
<input name="id[]" value="1" type="checkbox" checked=""
</form>

This is quite an ambiguous question. Can you elaborate on exactly what you're trying to achieve?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.