How to make Drupal 7 Editable field in table for admin only
<pre><code> $header = array(
    array('data' =&gt; t('S No'), 'field' =&gt; 't.id'),
    array('data' =&gt; t('Country Name'), 'field' =&gt; 't.country_name'),
    array('data' =&gt; t('Status'), 'field' =&gt; 't.status'),
    array('data' =&gt; t('Added Date'), 'field' =&gt; 't.added_date'),
    array('data' =&gt; t('Action'), 'field' =&gt; 't.id',),
    array('data' =&gt; t('Action'), '',),
  );



$limit = 10; 
  $query = db_select('countries', 't')-&gt;extend('TableSort')-&gt;extend('PagerDefault')-&gt;limit($limit)-&gt;orderby('country_name', ASC);
  //condition();
  $query-&gt;fields('t');
  //$edit=echo '&lt;i class="fa fa-pencil-square-o"&gt;&lt;/i&gt;';
  //$edit=echo '&lt;i class="fa fa-pencil-square-o"&gt;&lt;/i&gt;';
  // Don't forget to tell the query object how to find the header information.
  $result = $query
      -&gt;orderByHeader($header)
      -&gt;execute(); 

  $rows = array();
   $i=1;

  foreach ($result as $row) {

    $rows[] = array(
    $i,
    //($x === 2) ? 0 : $x+1,
    //$row-&gt;id,
    $row-&gt;country_name,
    //$row-&gt;status,
    //$row-&gt;status,
    $status = ($row-&gt;status == 0) ? 'Inactive' : 'Active',
    date('d-m-Y H:i:s', strtotime($row-&gt;added_date)),
    l('Edit', 'mypages/countries/'. $row-&gt;id), 
    l('Delete', 'mypages/delete/'. $row-&gt;country_name)

    );
//print_r($status);
    $i++;
  }
</code></pre>

<p>In this data where i am getting data from database and displaying it ..Now i want display the status as dynamic like admin can modify the status if he requires..</p>

<pre><code>$status = ($row-&gt;status == 0) ? 'Inactive' : 'Active',
</code></pre>

<p>Where he can make <code>active or inactive</code></p>

<p><strong>if we can give active or inactive in drop down its better ..where admin can select the status..after that automatically update to selected status...</strong>
and I am displaying S no as numbering which is ..the numbers working in first page like numbering auto increment where numbering to second page ..the numbering system is starting from the initial again...</p>

<p>What is the solutions for above </p>