Php 找不到服务器端处理问题类SSP
我想创建一个带有服务器端处理的datatable,但收到了错误消息: 获取错误'PHP message:PHP致命错误:未捕获错误:在SSP中找不到类'SSP'。PHP:45\n堆栈跟踪:\n#0{main}\n在第45行的SSP.PHP中抛出' 有人能帮我解决这个问题吗 这是我的密码:Php 找不到服务器端处理问题类SSP,php,Php,我想创建一个带有服务器端处理的datatable,但收到了错误消息: 获取错误'PHP message:PHP致命错误:未捕获错误:在SSP中找不到类'SSP'。PHP:45\n堆栈跟踪:\n#0{main}\n在第45行的SSP.PHP中抛出' 有人能帮我解决这个问题吗 这是我的密码: <table class="table" id="manageMemberTable">
<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>
服务器端脚本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 ));
?>
如果这是一个SQL问题,我们也需要查看您的SQL,以及示例表数据和预期结果-全部为格式化文本(而不是图像)。@jarlh php类未找到错误不能是mysql/SQL代码问题的结果,除非php文件本身存储在mysql中并从中检索。但是require部分就不会像这样工作了。当然,文件不是存储在mysql中的course@Shadow,这是一个反问句。(无论如何,谢谢!)@jarlh删除mysql标记会更简单,就像我做的那样:)
// 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 ));
?>