title: Server side sorted data not showing in same order in Datatables
body: <p>I am using Datatables to show data from a database. I am using CodeIgniter for serverside scripting. Here is the table image</p>
  
  <p><a href="https://i.stack.imgur.com/WNTcA.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/WNTcA.png" alt="enter image description here"></a></p>
  
  <p>In my serverside coding, I query to my database order by <strong>Country</strong> and in descending order.</p>
  
  <p>I have checked CodeIgniter select query for debugging purpose i.e</p>
  
  <pre><code>$this-&gt;db-&gt;get_compiled_select()
  </code></pre>
  
  <p>and it is showing </p>
  
  <pre><code>'SELECT *
  FROM `tmp`
  ORDER BY `country` DESC'
  </code></pre>
  
  <p>here <strong>tmp</strong> is my database name, and it's performing well.</p>
  
  <p>here is my json response from the database- (I can't show you the whole JSON response because of long text. That's why I use some online json parsing site to summarize my data.)</p>
  
  <p><a href="https://i.stack.imgur.com/N73mD.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/N73mD.png" alt="enter image description here"></a></p>
  
  <p>My json response showing data as per query to database i.e country column in desc order. That's why the first object is showing <strong>"Zimbabwe"</strong>. But in datatables it is showing other data i.e <strong>"Andora"</strong>.</p>
  
  <p>Here is my javascript -</p>
  
  <pre><code>    &lt;script type="text/javascript"&gt;
          $(document).ready( function () {
              $('#myTable').DataTable( {
                  "responsive": true,
                  "processing": true,
                  "serverSide": true,
                  "ajax": {
                      "url":  "http://localhost/adminDemo/admin/test",
                      "type": "POST"
                  },
                  "columnDefs" : [
                      {"width" : "20%", "targets" : 7},
                      {"width" : "30%", "targets" : 5},
                      { "orderable": false, "targets": 7 } //Don't order the action column
                  ]
              } );
          } );
      &lt;/script&gt;
  </code></pre>
  
  <p>If i set <strong>"order": [[ 6, "desc" ]]</strong> in datatables parameter, then it will be sorted after getting the json response. I don't want to add client-side script to order a column. I just want to use the sorted json response in datatables. Can anyone help me with this?</p>