Datatables serverside从Additional tables中选择WHERE

时间:2016-08-25 05:24:39

标签: php datatable datatables server-side

我有像这样的服务器。

$qteamwork = mysql_query("SELECT * FROM tw_rcpa_users WHERE leader='$selectuname'");
$rowteam = mysql_fetch_array($qteamwork);
$teamname = $rowteam['nama'];

$table = 'rcpa_click_report';     
$primaryKey = 'click_id';

$columns = array(
  array( 'db' => 'click_username',  'dt' =>'click_username' ),
  array( 'db' => 'click_landercode','dt' =>'click_landercode' ),
  array( 'db' => 'click_cid',       'dt' =>'click_cid' ),
  array( 'db' => 'click_offer',     'dt' =>'click_offer' ),
  array( 'db' => 'click_revenue',   'dt' =>'click_revenue' ),
  array( 'db' => 'click_country',   'dt' =>'click_country' ),
  array( 'db' => 'click_ip',        'dt' =>'click_ip' ),
  array( 'db' => 'click_device',    'dt' =>'click_device' ),
  array( 'db' => 'click_os',        'dt' =>'click_os' ),
  array( 'db' => 'click_browser',   'dt' =>'click_browser' ),
  array( 'db' => 'click_visittime', 'dt' =>'click_visittime' ),
);
// SQL server connection information    

$sql_details = array(
    'user' => '',
    'pass' => '',
    'db'   => '',
    'host' => ''
);
require( 'ssp.class.php' );
echo json_encode(
SSP::complex( $_GET, $sql_details, $table, $primaryKey, $columns, "click_username = '$teamname'")
);

但WHERE子句无法正常工作,此代码只显示第一个数组..

现在我要显示所有数据。怎么解决这个?谢谢..

0 个答案:

没有答案