Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/261.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 如何仅在服务器端处理中显示某些行?_Php_Datatables - Fatal编程技术网

Php 如何仅在服务器端处理中显示某些行?

Php 如何仅在服务器端处理中显示某些行?,php,datatables,Php,Datatables,我只想向登录用户显示某些行,其中服务器端处理中的“column_name”=“some_value”。目前我使用下面的代码 $table = 'tablename'; $primaryKey = 'id'; $columns = array( array( 'db' => 'id', 'dt' => 0 ), array( 'db' => 'name', 'dt' => 1 ), // need to only select where name ="exam

我只想向登录用户显示某些行,其中服务器端处理中的“column_name”=“some_value”。目前我使用下面的代码

$table = 'tablename';
$primaryKey = 'id';
$columns = array(
   array( 'db' => 'id', 'dt' => 0 ),
   array( 'db' => 'name', 'dt' => 1 ), // need to only select where name ="example"
   array( 'db' => 'views', 'dt' => 2 )
);
}
$sql_details = array(
   'user' => 'db_user',
   'pass' => 'db_pass',
   'db' => 'db_name',
   'host' => 'localhost:3306'
);
require( 'server-processing.php' );
echo json_encode(
    SSP::simple( $_GET, $sql_details, $table, $primaryKey, $columns )
);

如何实现这一点?

我们可以使用

  SSP::complex( $_GET, $sql_details, $table, $primaryKey, $columns , "column_name = 'some_value'"  )
使用
complex
代替
simple
,然后在括号内额外添加
“column\u name='some\u value'