I have this code here:
while ($record = mysql_fetch_array($itemavailablequeryres))
{
echo "
<tr>
<td>$record['itemid']</td>
<td>$record['code']</td>
<td>$record['name']</td>
<td><input type='checkbox' name='input'></td>
</tr> ";
}
Now the output in HTML would be:
<tr>
<td>1</td>
<td>105</td>
<td>t-racks</td>
<td>Mic splitter</td>
<td><input type='checkbox' name='input'></td>
</tr>
For each record of the database.
How can I implement a counter so that the input name will be +1 after each record?
So the output will be:
<tr>
...
<td><input type='checkbox' name='input1'></td>
...
</tr>
<tr>
...
<td><input type='checkbox' name='input2'></td>
...
</tr>
<tr>
...
<td><input type='checkbox' name='input3'></td>
...
</tr>
<tr>
...
<td><input type='checkbox' name='input4'></td>
...
</tr>
etc, depending on how many records are fetched.
You can create an array of checkboxes
If you still want to do with the counter
you could do like this