我使用多个表和多个mysql表。为此,我使用数据表进行服务器端处理。有没有办法从single server-proecssing.php使用不同的表并创建不同的表?
现在我克隆了server-processing.php(serverprocessing1.php,serverprocessing2.php)来生成不同的表。我想在单个文件上添加mysql,这样我就可以很容易地更改。
这是我的密码
<?php
/*
* DataTables example server-side processing script.
*
* Please note that this script is intentionally extremely simply to show how
* server-side processing can be implemented, and probably shouldn't be used as
* the basis for a large complex system. It is suitable for simple use cases as
* for learning.
*
* See http://datatables.net/usage/server-side for full details on the server-
* side processing requirements of DataTables.
*
* @license MIT - http://datatables.net/license_mit
*/
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Easy set variables
*/
// DB table to use
$table = 'new';
// Table's primary key
$primaryKey = 'id';
// Array of database columns which should be read and sent back to DataTables.
// The `db` parameter represents the column name in the database, while the `dt`
// parameter represents the DataTables column identifier. In this case simple
// indexes
$columns = array(
array( 'db' => 'name', 'dt' => 0 ),
array( 'db' => 'country', 'dt' => 1 ),
);
require( 'mysql.php' );
);
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* If you just want to use the basic configuration for DataTables with PHP
* server-side, there is no need to edit below this line.
*/
require( 'ssp.class.php' );
echo json_encode(
SSP::simple( $_GET, $sql_details, $table, $primaryKey, $columns )
);
这是mysql.php
$sql_details = array(
'user' => 'root',
'pass' => '123',
'db' => 'doo',
'host' => 'localhost'
我使用了php open和close标记,但它给出了错误。
提前谢谢你的帮助
暂无答案!
目前还没有任何答案,快来回答吧!