title: Datatables - How can i use an array as SQL where clause
body: <p>I'm trying to make a Datatable that dynamically loads data based on the user's settings. </p>
  
  <p><strong>On the server processing script</strong></p>
  
  <p>I have an array of branches owned by the current user. </p>
  
  <pre><code>$branchesOwned = $db-&gt;query('SELECT branchId FROM zapp_clt_branchesowner WHERE ownerId = ?', $ownerId)-&gt;fetchAll();
  </code></pre>
  
  <p>So far so good!</p>
  
  <p>i tried to create a secondary array where i would store the branchId from the 1st array :</p>
  
  <pre><code>$whereArray = [];
  
  foreach ($branchesOwned as $result) {
  array_push($whereArray, $result['branchId']);
  }
  </code></pre>
  
  <p>now on the SSP complex i have this:</p>
  
  <pre><code>//$whereAll = "status = 'B Activo' AND branchID IN ('1')"; &lt;--- WORKING
  $whereAll = "status = 'B Activo' AND branchID IN {$whereArray}"; // &lt;--- NOT WORKING
  
  
  echo json_encode(
  SSP::complex( $_GET, $sql_details, $table, $primaryKey, $columns, $whereResult = null, $whereAll)
  );
  </code></pre>
  
  <p>As you can see if it write the array directly in the $whereAll it works</p>