title: capture the row after search with id
body: <p>sample form in html</p>
  
  <pre><code>&lt;form action="search.php" method="get"&gt;
  &lt;label&gt;Name:
  &lt;input type="text" name="keyname" /&gt;
  &lt;/label&gt;
  &lt;input type="submit" value="Search" /&gt;
  &lt;/form&gt; 
  </code></pre>
  
  <p>When I am trying to search it displays entire row with all fields. That's good. but not capture that details when i click on Edit.</p>
  
  <p>search.php file:
      
  
  <pre><code>//capture search term and remove spaces at its both ends if the is any
  $searchTerm = trim($_GET['keyname']);
  
  //check whether the name parsed is empty
  if($searchTerm == "")
  {
  echo "Enter name you are searching for.";
  exit();
  }
  
  //database connection info
  $host = "xxx"; //server
  $db = "xxx"; //database name
  $user = "xxx"; //dabases user name
  $pwd = "xxx"; //password
  
  //connecting to server and creating link to database
  $link = mysqli_connect($host, $user, $pwd, $db);
  
  //MYSQL search statement
  $query = "SELECT * FROM customer_details WHERE id LIKE '%$searchTerm%'";
  
  $results = mysqli_query($link, $query);
  
  /* check whethere there were matching records in the table
  by counting the number of results returned */
  if(mysqli_num_rows($results) &gt;= 1)
  {
  $output = "";
  echo '&lt;table border=1 width=999&gt;
  &lt;tr&gt;
      &lt;th valign=top&gt;ID&lt;/th&gt;
      &lt;th valign=top&gt;Name&lt;/th&gt;
      &lt;th valign=top&gt;Telephone&lt;/th&gt;
      &lt;th valign=top&gt;E-mail&lt;/th&gt;
      &lt;th valign=top&gt;Country Visiting for&lt;/th&gt;
      &lt;th valign=top&gt;Visa Category&lt;/th&gt;
      &lt;th valign=top&gt;Other Category&lt;/th&gt;
      &lt;th valign=top&gt;Passport No&lt;/th&gt;
      &lt;th valign=top&gt;Remarks&lt;/th&gt;
      &lt;th valign=top&gt;Date(Created)&lt;/th&gt;
      &lt;th valign=top&gt;Updated Remarks&lt;/th&gt;
      &lt;th valign=top&gt;Updated Date&lt;/th&gt;
  
  &lt;/tr&gt;';
  
  while ($row = mysqli_fetch_array($results)) {
  echo '
      &lt;tr&gt;
          &lt;td&gt;'.$row['id'].'&lt;/td&gt;
          &lt;td&gt;'.$row['name'].'&lt;/td&gt;
          &lt;td&gt;'.$row['Telephone'].'&lt;/td&gt;
          &lt;td&gt;'.$row['E_mail'].'&lt;/td&gt;
          &lt;td&gt;'.$row['country'].'&lt;/td&gt;
          &lt;td&gt;'.$row['visa_categeory'].'&lt;/td&gt;
          &lt;td&gt;'.$row['other_category'].'&lt;/td&gt;
          &lt;td&gt;'.$row['passport_no'].'&lt;/td&gt;
          &lt;td&gt;'.$row['remarks'].'&lt;/td&gt;
          &lt;td&gt;'.$row['date'].'&lt;/td&gt;
          &lt;td&gt;'.$row['updated_remarks'].'&lt;/td&gt;
          &lt;td&gt;'.$row['updated_date'].'&lt;/td&gt;
  
      &lt;/tr&gt;';
  
  
  }
  
  echo '
  &lt;/table&gt;';
  echo $output;
  }
  else
  echo "There was no matching record for the name " . $searchTerm;
  ?&gt;
  
  &lt;div&gt;&lt;a href="update.php?id=$id"&gt;Edit&lt;/a&gt;&lt;/div&gt;
  </code></pre>
  
  <p>and my update.php file looking like this.</p>
  
  <pre><code>&lt;?php
  $host="xxx"; // Host name 
  $username="xxx"; // Mysql username 
  $password="xxx"; // Mysql password 
  $db_name="xxx"; // Database name 
  $tbl_name="customer_details"; // Table name
  
  // Connect to server and select database.
  mysql_connect("$host", "$username", "$password")or die("cannot connect"); 
  mysql_select_db("$db_name")or die("cannot select DB");
  
  // get value of id that sent from address bar
  $id=intval($_GET['id']);
  
  // Retrieve data from database 
  $sql="SELECT * FROM $tbl_name WHERE id='$id'";
  $result=mysql_query($sql);
  $rows=mysql_fetch_array($result);
  ?&gt;
  
  &lt;table width="400" border="0" cellspacing="1" cellpadding="0"&gt;
  &lt;tr&gt;
  &lt;form name="form1" method="post" action="update_ac.php"&gt;
  &lt;td&gt;
  &lt;table align="center" style="margin-left:100px" width="600" border="0" cellspacing="1"     cellpadding="0"&gt;
  
  &lt;tr&gt;
  &lt;td align="left"&gt;&lt;strong&gt;ID&lt;/strong&gt;&lt;/td&gt;&lt;td align="left"&gt;
  &lt;input name="id" disabled type="text" id="id" value="&lt;?php echo $rows['id']; ?&gt;"&gt;
  &lt;/td&gt;&lt;/tr&gt;
  
  &lt;tr&gt;
  &lt;td align="left"&gt;&lt;strong&gt;Name&lt;/strong&gt;&lt;/td&gt;&lt;td align="left"&gt;
  &lt;input name="name" disabled type="text" id="name" value="&lt;?php echo $rows['name']; ?&gt;"&gt;
  &lt;/td&gt;&lt;/tr&gt;
  
  &lt;tr&gt;
  &lt;td align="left"&gt;&lt;strong&gt;Telephone&lt;/strong&gt;&lt;/td&gt;&lt;td align="left"&gt;
  &lt;input name="Telephone" disabled type="text" id="Telephone" value="&lt;?php echo     $rows['Telephone']; ?&gt;"&gt;
  &lt;/td&gt;&lt;/tr&gt;
  &lt;tr&gt;
  &lt;td align="left"&gt;&lt;strong&gt;Country Visiting for&lt;/strong&gt;&lt;/td&gt;&lt;td align="left"&gt;
  &lt;input name="country" disabled type="text" id="country" value="&lt;?php echo     $rows['country']; ?&gt;"&gt;
  &lt;/td&gt;&lt;/tr&gt;
  &lt;tr&gt;
  &lt;td align="left"&gt;&lt;strong&gt;Visa Category&lt;/strong&gt;&lt;/td&gt;&lt;td align="left"&gt;
  &lt;input name="visa_categeory" disabled type="text" id="visa_categeory" value="&lt;?php     echo $rows['visa_categeory']; ?&gt;"&gt;
  &lt;/td&gt;&lt;/tr&gt;
  &lt;tr&gt;
  &lt;td align="left"&gt;&lt;strong&gt;Other Category&lt;/strong&gt;&lt;/td&gt;&lt;td align="left"&gt;
  &lt;input name="other_category" disabled type="text" id="other_category" value="&lt;?php     echo $rows['other_category']; ?&gt;"&gt;
  &lt;/td&gt;&lt;/tr&gt;
  
  &lt;tr&gt;
  &lt;td align="left"&gt;&lt;strong&gt;Remarks&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;
  &lt;textarea name="remarks" id="remarks" value="&lt;?php echo $rows['remarks']; ?&gt;"     size="20"&gt;&lt;?php echo $rows['remarks']; ?&gt;&lt;/textarea&gt;
  &lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;
  &lt;td align="left"&gt;&lt;strong&gt;Date&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;
  &lt;input name="date" type="text" id="date" value="&lt;?php echo $rows['date']; ?&gt;"     size="20"&gt;
  &lt;/td&gt;&lt;/tr&gt;
  
  &lt;tr&gt;
  &lt;td align="left"&gt;&lt;strong&gt;Modified Remarks&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;
  &lt;textarea name="updated_remarks" id="updated_remarks" value="&lt;?php echo     $rows['updated_remarks']; ?&gt;" size="20"&gt;&lt;?php echo $rows['updated_remarks']; ?&gt;&lt;/textarea&gt;    &lt;/td&gt;&lt;/tr&gt;
  &lt;tr&gt;
  &lt;td align="left"&gt;&lt;strong&gt;Modified Date&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;
  &lt;input name="updated_date" type="text" id="updated_date" value="&lt;?php echo     $rows['updated_date']; ?&gt;" size="20"&gt;
  &lt;/td&gt;&lt;/tr&gt;
  &lt;tr&gt;
  &lt;td&gt;&amp;nbsp;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
  &lt;td&gt;
  &lt;input name="id" type="hidden" id="id" value="&lt;?php echo $rows['id']; ?&gt;"&gt;
  &lt;/td&gt;
  &lt;td align="left"&gt;
  &lt;input type="submit" name="Submit" value="Update"&gt;
  &lt;/td&gt;
  &lt;td&gt;&amp;nbsp;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;/table&gt;
  &lt;/td&gt;
  &lt;/form&gt;
  &lt;/tr&gt;
  &lt;/table&gt;
  &lt;?php
  // close connection 
  mysql_close();
  ?&gt;
  </code></pre>
  
  <p>and finally update_ac.php looking like this.</p>
  
  <pre><code>&lt;?php
  $host="xxx"; // Host name 
  $username="xxx"; // Mysql username 
  $password="xxx"; // Mysql password 
  $db_name="xxx"; // Database name 
  $tbl_name="customer_details"; // Table name 
  $id=$_POST['id'];
  $name=$_POST['name'];
  $remarks=$_POST['remarks'];
  $date=$_POST['date'];
  $updated_remarks=$_POST['updated_remarks'];
  $updated_date=$_POST['updated_date'];
  
  // Connect to server and select database.
  mysql_connect("$host", "$username", "$password")or die("cannot connect"); 
  mysql_select_db("$db_name")or die("cannot select DB");
  
  // update data in mysql database 
  $sql="UPDATE $tbl_name SET id='$id', name='$name', remarks='$remarks', date='$date',     updated_remarks='$updated_remarks', updated_date='$updated_date' WHERE     id='$id'";
  $result=mysql_query($sql);
  
  // if successfully updated. 
  if($result){
  echo "Successful";
  echo "&lt;BR&gt;";
  header('Location: list_records.php');
  }
  
  else {
  echo "ERROR";
  }
  
  ?&gt;
  </code></pre>
  
  <p>Now I am Explaining this.</p>
  
  <p>When I am trying to search with id it displays entire row(all fields).
  But When I click on Edit in that file it doesn't capture that row details(that fields) I am asking How to capture that row details(all fields).
  Thanks in Advance.</p>