No, i am looing that at left side why count not incrementing(1 to 10) like $i, even it shows only 10 which is repeating again & again.
due which my db_table not updated properly, in my table i am trying to update 10 row but unfortunately the above code update last row of table only.

$count is not supposed to increment. It is the total count (length) of the $_POST['text1'] array:

$count = count($_POST['text1']);

Okay, can you please tell me then what proper variable will be used if i update db_table

below sample form which i wana update...

          <td id="a1" class="box190">&raquo;&nbsp;<input type="hidden" name="nd[]" value="1" /></td>
          <td align="right"><input name="text10[]" type="text" class="box25" id="r1" value="<?php echo $vote_gain_p[0]; ?>" />
            %</td> <!-- onselect="format(this);" -->
          <td align="center"><input name="text[]" type="text" class="box70c" id="c1" readonly="readonly" value="<?php echo $vote_gain_n[0]; ?>"   /></td>
          <td class="box190" id="a2">&raquo;&nbsp;<input type="hidden" name="nd[]" value="2" /></td>
          <td align="right"><input name="text10[]" type="text" class="box25" id="r2" value="<?php echo $vote_gain_p[1]; ?>" />
          <td align="center"><input name="text[]" type="text" class="box70c" id="c2" readonly="readonly" value="<?php echo $vote_gain_n[1]; ?>" /></td>

Kind Regards

Depends on what your unique key(s) is (are) in the database. You use unique key(s) to construct the input fields in the form and then to use input data to update targeted rows in the database (using WHERE clause).

Main problem in your code is, in my opinion, the fact that you use different names for database fields, form element names (which are used also in the $_POST as indexes) and variable names. And the names are not very descriptive. The result is that I do not understand the code and you have troubles spotting errors.

Be a part of the DaniWeb community

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