0

Dear,
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.

Edited by ismael ahm@d: +

0

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

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

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...

<tr>
          <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>
        </tr>
        <tr>
          <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>
          <td align="center"><input name="text[]" type="text" class="box70c" id="c2" readonly="readonly" value="<?php echo $vote_gain_n[1]; ?>" /></td>
        </tr>

--
Kind Regards

Edited by ismael ahm@d: +

0

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.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.