
Originally Posted by
Kalon
The first thing you need to do is make sure all the checkboxes for each ID in your form have the same name. Then each ID will send an array of checked checkboxes.
The name should include the ID value to make it easier in the php script to see which ID the checkbox values belong to.
Your php script will then receive an array of checked checkbox values for each ID.
You then loop thorough each set of checkboxes for each ID and build your update query based on the values of the checkboxes for that ID. The value of each checkbox will tell you which columns you need to include in your update query.
After you build an update query for each ID, then run it to update the selected columns for that ID.
Thank you for your help, but, since i'm new in php i don't know how to do that.
Field Names are:
Code:
PakIndex
PakHot
PakNew
PakAktiv
And the html list looks like this:
HTML Code:
<span class="result_column" style="width: 7%;"><center><input type="checkbox" style="checkbox" name="PakAktiv" value="2" /></center></span>
<span class="result_column" style="width: 6%;"><center><input type="checkbox" style="checkbox" name="PakAktiv" value="2" /></center></span>
<span class="result_column" style="width: 6%;"><center><input type="checkbox" style="checkbox" name="PakAktiv" value="2" checked="checked" /></center></span>
<span class="result_column" style="width: 8%;"><center><input type="checkbox" style="checkbox" name="PakAktiv" value="2" checked="checked" /></center></span>
Where value=ID of the row. In this case, the row have ID 2
I have changed the type of field for this fields to TINYINT with values 1 and 0 from ENUM.
The tablename is paketa.
Now, having all this details, can you help me to build that query and function, PLEASE?
Thank you in advance!
Bookmarks