title: how can i fetch data from database and fill <input type=“text”> when page opens
body: <p>i have a site that displays massages from users stored in a database. what i want is when i click the reply link beside each message a new page must load and the details from each message must be filled in the <strong></strong> and how to i get the specific data for a particulate row after i loop through. </p>
  
  <pre><code>&lt;?php 
  $dbcon=mysqli_connect("localhost","root","","technoage");
  
  // Check connection
  if (mysqli_connect_errno())
  {
      echo "Failed to connect to MySQL: " . mysqli_connect_error();
  }
  mysqli_select_db($dbcon,"technoage") or die ("database not found!!!");
  
  $r = mysqli_query($dbcon,"SELECT * FROM messages LIMIT $startrow,10 "); // Run the query.
  if($r) { // If it ran OK, display the Table header.
      echo '&lt;table class="table"&gt; &lt;tr&gt;&lt;td&gt;&lt;b&gt;Name of sender&lt;/b&gt;&lt;/td&gt;&lt;td&gt;&lt;b&gt;Senders Details&lt;/b&gt;&lt;/td&gt;&lt;td&gt;&lt;b&gt;Message&lt;/b&gt;&lt;/td&gt;&lt;td&gt;&lt;b&gt;Reply To Massage&lt;/b&gt;&lt;td/&gt;&lt;/tr&gt;';
  
      while ($row = mysqli_fetch_array($r,MYSQLI_ASSOC)) 
      { 
          echo'&lt;tr&gt;&lt;td&gt;'.'Name: '.$row['name'].'&lt;/td&gt;&lt;td&gt; '.'Email: '.$row['email_address'] .'&lt;br&gt;Subject: '.$row['message_subject'].'&lt;br&gt;Phone: '.$row['phone'].'&lt;br&gt;Date Sent: '.$row['date_sent']. '&lt;/td&gt;&lt;td&gt;'.'Message: '.$row['message'].'&lt;/td&gt;&lt;td&gt;&lt;a     href="#"&gt;Reply&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;';
      }
      echo '&lt;/table&gt;';
  }
  </code></pre>
  
  <p>when the reply link is clicked a page must load with the details of the massage clicked.</p>
  
  <p>the reply file is</p>
  
  <pre><code>&lt;?php 
      $dbcon=mysqli_connect("localhost","root","","technoage");
      if (mysqli_connect_errno())
      {
          echo "Failed to connect to MySQL: " . mysqli_connect_error();
      }
      mysqli_select_db($dbcon,"technoage") or die ("database not found!!!");
  
      // Run the query.
  
      echo'&lt;form method="post" action="includes/insert.php"&gt;';
      echo'&lt;label for="name"&gt;Name:&lt;/label&gt;&lt;br&gt;';
      echo'&lt;input type="text" class="text" name="name" id="name" /&gt;&lt;br&gt;';
      echo'&lt;label for="email"&gt;E-mail Address:&lt;/label&gt;&lt;br&gt;';
      echo'&lt;input type="text" class="text" name="email" id="email" /&gt;&lt;br&gt;';
      echo'&lt;label for="phone"&gt;Phone:&lt;/label&gt;&lt;br&gt;';
      echo'&lt;input type="text" class="text" name="phone" id="phone" /&gt;&lt;br&gt;';
      echo'&lt;label for="text"&gt;Message Subject:&lt;/label&gt;&lt;br&gt;';
      echo'&lt;input type="text" class="text" name="message_subject" id="message_subject"&gt;&lt;/textarea&gt;&lt;br&gt;';
      echo'&lt;label for="text"&gt;Message:&lt;/label&gt;&lt;br&gt;';
      echo'&lt;textarea class="text" name="message" id="text"&gt;&lt;/textarea&gt;&lt;br&gt;';
      echo'&lt;input type="submit" class="submit" value="Send" /&gt;';
      echo'&lt;/form&gt;';
  ?&gt;
  </code></pre>