title: Datatables Simple Join Query
body: <p>I am putting together a simple join query using Datatables Editor however am getting errors which I don't understand. My code is below:</p>
  
  <p>HTML</p>
  
  <pre><code>            &lt;!-- Actions --&gt;
              &lt;div id="divActions" class="tab-pane fade"&gt;
                  &lt;ul class="nav nav-list"&gt;
                      &lt;!-- Actions Tab Header --&gt;
                      &lt;legend id="lgdActions"&gt;Actions&lt;/legend&gt;
                      &lt;table id="tblActions" class="display" cellspacing="0" width="100%"&gt;&lt;/table&gt;
                  &lt;/ul&gt;
              &lt;/div&gt;
  </code></pre>
  
  <p>Javascript</p>
  
  <pre><code>             Actions Datagrid
              $('#tblActions').DataTable({
                  dom: "Tfrtip",
                  lengthChange: false,
                  bAutoWidth: false,
                  jQueryUI: true,
                  bProcessing: true,
                  bServerSide: true,
                  ajax: {
                      url: "dataGridQuery.php",
                      data: { "gridNumber": 2 },
                      type: 'POST'
                  },
                  columns: [
                      { title: "Action ID", data: "tblActions.actionID", width: "10%" },
                      { title: "Time", data: "tblActions.actionTime" },
                      { title: "Action Taken", data: "tblActions.actionTaken" },
                      { title: "User", data: "tblUsers.userID" }
                  ]
                  tableTools: {
                      sRowSelect: "os",
                      aButtons: [
                          { sExtends: "editor_create", editor: editor1 },
                          { sExtends: "editor_edit",   editor: editor1 },
                          { sExtends: "editor_remove", editor: editor1 }
                      ]
                  }
              });
  </code></pre>
  
  <p>PHP</p>
  
  <pre><code>            // Obtain Action Grid
              if(isset($_GET['gridNumber']) &amp;&amp; $_GET['gridNumber']==2){ 
              //
              $data = Editor::inst( $db, 'tblActions' )
                  -&gt;field(
                      Field::inst( 'tblActions.actionID' ),
                      Field::inst( 'tblActions.actionTime' ),
                      Field::inst( 'tblActions.actionTaken' ),
                      Field::inst( 'tblActions.actionUserID' ),
                      Field::inst( 'tblUsers.userID' )
                  )
                  -&gt;leftJoin( 'tblUsers', 'tblUsers.userID', '=', 'tblActions.actionUserID' )
                  -&gt;process($_POST)
                  -&gt;data();
              //
              if ( ! isset($_POST['action']) ) {
                  // Get a list of sites for the `select` list
                  $data['tblUsers'] = $db
                      -&gt;selectDistinct( 'tblUsers', 'userID as value, userID as label' )
                      -&gt;fetchAll();
              }
              // Echo 
              echo json_encode( $data );
              }
  </code></pre>
  
  <p>The errors I receive when running this code are:</p>
  
  <ul>
  <li>Errors {"error":"SQLSTATE[42S22]: Column not found: 1054 Unknown
  column 'tblActions.id' in 'field
  list'","data":[],"tblUsers":[{"value":"1","label":"1"},{"value":"2","label":"2"}]}</li>
  <li>DataTables warning: table id=tblActions - Invalid JSON response. For
  more information about this error, please see
  <a href="http://datatables.net/tn/1" rel="nofollow">http://datatables.net/tn/1</a>.</li>
  </ul>
  
  <p>This code was from a sample provide when downloading the Editor v1.3.1.  I am somewhat familiar with the plug-in however find it perplexing when such an error occurs.  Any help would be much appreciated.</p>
  
  <p>Thanks :)</p>