Displaying database row with while loop in input

0

I am trying to do something where it is possible to change the values of each row to then update the database but I am not understand why my input value only shows the first one in the database and as the while repeats create that the values would be changed to the following row!

while($row =  mysqli_fetch_assoc($querypesquisa_run))
  {  
 echo "<tr>";
 echo "<td>" . $row['id'] . "</td>";
echo "<td>" . $row['titulo'] . "</td>";
 echo "<td>" . $row['texto'] . "</td>";
echo "<td>" . $row['data'] . "</td>";
echo "<td>" . $row['nome'] . "</td>";
  echo "</tr>";

   echo '
  <br>
  <button type="button" name="editar" data-toggle="modal" data- 
  target="#myModal" style="float: right; margin-right:1132px; margin-top:39px; 
   font-size:11px;margin-bottom:-35px;">Editar Noticia </button>


  <form method="post" action="">
  <div id="myModal" class="modal fade" 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">Altere a sua noticia</h4>
  </div>
  <div class="modal-body">
 <input type="text" value="'.$row['titulo'].'"><br>
   <input type="text"  value="'.$row['texto'].'">     <br>
 <input type="text" value="'.$row['data'].'"><br>
  <input type="text"  value="'.$row['nome'].'"><br>


  </div>
  <div class="modal-footer">
  <button type="button" class="btn btn-default" name="alterar">Alterar 
      Noticia</button>
    <button type="button" class="btn btn-default" data- 
     dismiss="modal">Fechar</button>
      </div>
    </div>

  </div>
    </div>
   </form>';
    }
     echo "</table>";
     ?>
    
asked by anonymous 18.05.2018 / 17:13

0 answers