Making a hyperlink of each of the rows in data-grid table
<p>I have a script that fills a data-grid table. I want to make a hyperlink of each of the rows that gets displayed.</p>

<p>The hyperlinks should look like <code>&lt;a href"index.php?id=(id of the row)"&gt;</code></p>

<p>How can I do that with my current script.</p>

<p>Here is my script:</p>

<pre><code>&lt;?php
 // initilize all variable
 $params = $columns = $totalRecords = $data = array();
 $params = $_REQUEST;

 //define index of column
 $columns = array( 
  0 =&gt; 'id',
  1 =&gt; 'name',
 );
 $where = $sqlTot = $sqlRec = "";

 // check search value exist
 if( !empty($params['search']['value']) ) {   
  $where .=" WHERE ";
  $where .=" name LIKE '".$params['search']['value']."%'";
 }

 // getting total number records without any search
 $sql = "SELECT id, name FROM `customers`";
 $sqlTot .= $sql;
 $sqlRec .= $sql;

 //concatenate search sql if value exist
 if(isset($where) &amp;&amp; $where != '') {
  $sqlTot .= $where;
  $sqlRec .= $where;
 }

 $sqlRec .=  " ORDER BY ". $columns[$params['order'][0]['column']]."   ".$params['order'][0]['dir']."  LIMIT ".$params['start']." ,".$params['length']." ";
 $queryTot = mysqli_query($conn, $sqlTot) or die("database error:". mysqli_error($conn));
 $totalRecords = mysqli_num_rows($queryTot);
 $queryRecords = mysqli_query($conn, $sqlRec) or die("error to fetch customers data");

 //iterate on results row and create new index array of data
 while( $row = mysqli_fetch_row($queryRecords) ) { 
  $data[] = $row;
 }  

 $json_data = array(
 "draw"            =&gt; intval( $params['draw'] ),   
 "recordsTotal"    =&gt; intval( $totalRecords ),  
 "recordsFiltered" =&gt; intval($totalRecords),
 "data"            =&gt; $data   // total data array
 );

 echo json_encode($json_data);  // send data as json format
?&gt;
</code></pre>

<p><strong>Edit 1:</strong></p>

<p>Here I am displaying the data:</p>

<pre><code>&lt;table id="employee_grid" class="display" width="100%" cellspacing="0"&gt;
 &lt;thead&gt;
  &lt;tr&gt;
   &lt;th&gt;ID&lt;/th&gt;
   &lt;th&gt;Name&lt;/th&gt;
  &lt;/tr&gt;
 &lt;/thead&gt;
&lt;/table&gt;

&lt;script type="text/javascript"&gt;
 $( document ).ready(function() {
  $('#employee_grid').DataTable({
   "bProcessing": true,
   "serverSide": true,
   "ajax":{
    url :"get.php", // json datasource
    type: "post",  // type of method  ,GET/POST/DELETE
    error: function(){
     $("#employee_grid_processing").css("display","none");
    }
   }
  });   
 });
&lt;/script&gt;   
</code></pre>