我想通过服务器端处理创建数据表,但是我收到该错误消息:
出现错误'PHP消息:PHP致命错误:未捕获的错误:在ssp.php:45 \ nStack跟踪中找不到类'SSP':\ n#0 {main} \ n在第45行的ssp.php中抛出了'
有人可以帮助我解决该问题吗?
这是我的代码:
<table class="table" id="manageMemberTable">
<thead>
<tr>
<th>ID</th>
<th>Nom</th>
<th>Téléphone</th>
<th>Zone</th>
<th>Localisation</th>
<th>Mensualité</th>
</tr>
</thead>
</table>
这是js代码:
manageMemberTable = $("#manageMemberTable").DataTable({
"processing": true,
"serverSide": true,
"ajax": "php_action/ssp.php",
"order": []
});
服务器端脚本ssp.php
// Database connection info
$dbDetails = array(
'host' => 'xxxx',
'user' => 'xxxx',
'pass' => 'xxxx',
'db' => 'xxxx'
);
// DB table to use
$table = 'clients';
// 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.
// The `dt` parameter represents the DataTables column identifier.
$columns = array(
array( 'db' => 'id', 'dt' => 0 ),
array( 'db' => 'nom', 'dt' => 1 ),
array( 'db' => 'tel', 'dt' => 2 ),
array( 'db' => 'zone', 'dt' => 3 ),
array( 'db' => 'localisation', 'dt' => 4 ),
array( 'db' => 'mensualite', 'dt' => 5 ),
);
// Include SQL query processing class
require 'ssp.class.php';
$where = "entreprise_id='15' AND status !='supprime'";
// Output data as json format
echo json_encode(SSP::simple( $_GET, $dbDetails, $table, $primaryKey, $columns, $where ));
?>