mysql - Get user_ID from Modal via PHP -


i'm trying pass id's each modal fetched rows. if try edit_id value, returns first fetched value. missing? can please me?

while($row=mysqli_fetch_row($result_set)){?>              <li class="gen-row">                 <div class="gen">                      <div class="gen-controls">                         <div class="gen-control"><a href="#" data-toggle="modal" data-target="#mymodal<?php echo $row[0]; ?>"><span class="glyphicon glyphicon-pencil"></span></a></div>                          <!-- edit modal -->                         <div class="modal fade" id="mymodal<?php echo $row[0]; ?>" role="dialog">                             <div class="modal-dialog">                                  <!-- modal content-->                                 <div class="modal-content">                                     <div class="modal-header">                                         <button type="button" class="close" data-dismiss="modal">&times;</button>                                         <h4 class="modal-title">erstellen sie ein neues genogramm </h4>                                     </div>                                     <div class="modal-body">                                          <form action="edit_data.php" method="post" id="genogramm-anlegen">                                             <input type="text" id="edit_id" name='edit_id' value='<?php echo $row[0]; ?>'>                                         </form>                                      </div>                                     <div class="modal-footer">                                         <button type="submit" class="btn btn-default" form="genogramm-anlegen" name="btn_edit">speichern</button>                                         <button type="button" class="btn btn-default" data-dismiss="modal">abbrechen</button>                                     </div>                                 </div>                             </div>                         </div>                       </div>                 </div>             </li>               <?php         } 

the edit_data.php:

if(isset($_post['btn_edit'])) {  $user_id = mysqli_real_escape_string($link, $_request['edit_id']);  echo $user_id; 


Comments

Popular posts from this blog

How to understand 2 main() functions after using uftrace to profile the C++ program? -

c# - Update a combobox from a presenter (MVP) -

How to put a lock and transaction on table using spring 4 or above using jdbcTemplate and annotations like @Transactional? -