title: pass id when using table in ajax
body: <p>Im new to ajax,no even learn from others<br/>
  Now i face a problem with passing id when using ajax<br>
  index.php</p>
  
  <pre><code>&lt;table id="employee_grid" class="display" width="100%" cellspacing="0"&gt;
                  &lt;thead&gt;
                    &lt;tr&gt;
                      &lt;th&gt;N0&lt;/th&gt;
                      &lt;th&gt;TICKET ID &lt;/th&gt;
                      &lt;th&gt;CATEGORY &lt;/th&gt;
                      &lt;th&gt;ORDER TYPE&lt;/th&gt;
                      &lt;th&gt;RECEIVED DATE  &lt;/th&gt;
                      &lt;th&gt;AGENT/STAFF NAME  &lt;/th&gt;
                      &lt;th&gt;EFORM ID&lt;/th&gt;
                      &lt;th&gt;LATEST ORDER STATUS&lt;/th&gt;
                      &lt;th style="width:170px;"&gt;Edit&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 :"run.php", // json datasource
  
          type: "post",  // type of method  , by default would be get
          "aoColumnDefs" : [
               {
                 'bSortable' : false,
                 'aTargets' : [3,4]
               }],
          "dataSrc": function (jsonData) {
            for ( var i=0, len=jsonData.data.length ; i&lt;len ; i++ ) {
              jsonData.data[i][1] = jsonData.data[i][1]+jsonData.data[i][2]+jsonData.data[i][3]+jsonData.data[i][4];
              jsonData.data[i][8] = '&lt;a href="cus_details.php"  class="btn btn-primary btn-xs"&gt; View Details &lt;/a&gt;   &lt;a href="update_details.php" class="btn btn-primary btn-xs"&gt; Update Status &lt;/a&gt;';
            }
  
            return jsonData.data;
          },
          error: function(){  // error handling code
           // $(".employee-grid-error").html("");
            //$("#employee_grid").append('&lt;tbody class="employee-grid-error"&gt;            &lt;tr&gt;&lt;th colspan="3"&gt;No data found in the server&lt;/th&gt;&lt;/tr&gt;&lt;/tbody&gt;');
            $("#employee_grid_processing").css("display","none");
          }
        }
      });   
  });
  
  &lt;/script&gt;
  </code></pre>
  
  <p>I know i should add some thing a href="cus_details.php?XXXXXXX" ,but i dunno need to put what</p>
  
  <p>run.php</p>
  
  <pre><code>&lt;?php
  //include connection file 
  include_once("conn.php");
  
  // initilize all variable
  $params = $columns = $totalRecords = $data = array();
  
  $params = $_REQUEST;
  
  //define index of column(sorting)
  $columns = array( 
      0 =&gt; 'NO_ID',
      1 =&gt; 'TICKET_ID', 
      2 =&gt; 'CAT_C_B',
      3 =&gt; 'ORDER_TYPE',
      4 =&gt; 'RECEIVED_DATE',
      5 =&gt; 'AGENT_STAFF_NAME',
      6 =&gt; 'EFORM_ID',
      7 =&gt; 'LATEST_ORDER_STATUS'
  );
  
  $where = $sqlTot = $sqlRec = "";
  
  // check search value exist(search)
  if( !empty($params['search']['value']) ) 
  {   
      $where .=" WHERE ";
      $where .=" ( NO_ID LIKE '".$params['search']['value']."%' ";    
      $where .=" OR TICKET_ID LIKE '".$params['search']['value']."%' ";
      $where .=" OR CAT_C_B LIKE '".$params['search']['value']."%' ";
      $where .=" OR ORDER_TYPE LIKE '".$params['search']['value']."%' ";
      $where .=" OR RECEIVED_DATE LIKE '".$params['search']['value']."%' ";
      $where .=" OR AGENT_STAFF_NAME LIKE '".$params['search']['value']."%' ";
      $where .=" OR EFORM_ID LIKE '".$params['search']['value']."%' ";
      $where .=" OR LATEST_ORDER_STATUS LIKE '".$params['search']['value']."%' )";
  }
  
  // getting total number records without any search
  $sql = "SELECT * FROM `cusinfo` ";
  $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 cusinfo 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>