<?php
$connect = mysqli_connect("localhost", "root", "", "practicas");
if(!empty($_POST))
{

 $output = '';
 $estare= $_POST['estars'];

 $nombres = mysqli_real_escape_string($connect, $_POST["nombres"]);  
  
   
     $query = " UPDATE clientes SET  instruccion = '$nombres' WHERE id = '$estare'";
    if(mysqli_query($connect, $query))
    {
     $output.= '<label class="text-success">Registro Insertado Correctamente</label>';
     //$select_query = "UPDATE clientes SET estado ='$esta', instruccion = '$estare' WHERE id = '$estar'";
     $select_query = "SELECT * FROM clientes ORDER BY id DESC";
     //$sql = "UPDATE clientes SET estado ='$esta', instruccion = '$estare' WHERE id = '$estar'";
     $result = mysqli_query($connect, $select_query);
     $output.='
      <table class="table table-bordered">  
         <tr>  
       <th width="30%">Personal Nombres</th>  
     
        </tr>';
     while($row = mysqli_fetch_array($result))
     {
      $output .= '<tr>  
       <td>'.$row["nombre"].'</td>
      
       <td><input type="button" name="view" value="Vista Previa" id="' . $row["id"] . '" class="btn btn-info btn-xs view_data" /></td>  
        </tr>';
     }
     $output.= '</table>';
    }
    echo $output;
}
?>