0
SQLite3のを使用して処理するDataTables.netサーバーサイドのサブセットが常にDataTables.netサーバー側の処理の詳細については、エラーUnable to execute statement: datatype mismatch
文を実行することができません:データ型の不一致
// Handle Server Side ajax request from DataTables in browser
// init database
$db = new SQLite3('appname.SQLite3.db');
// parse request parameters
$start = (int) $_GET['start'];
$length = (int) $_GET['length'];
// Prepare statement
$sql = "
SELECT
personId, personName
FROM person
LIMIT :start, :length
";
$stmt = $db->prepare($sql);
$stmt->bindParam(':start', $start);
$stmt->bindParam(':length', $length);
// execute statement
$result = $stmt->execute();
$response['data'] = [];
while ($row = $result->fetchArray(SQLITE3_NUM)) {
$response['data'][] = $row;
}
// use same prepared statement to count not paged number of records
$start = 0;
$length = PHP_INT_MAX;
$result = $stmt->execute(); // <---- fails here with datatype mismatch error -------
$recordsTotal = 0;
while ($result->fetchArray(SQLITE3_NUM)) {
$recordsTotal++;
}
$response['draw'] = (int) $_GET['draw']; // used by DataTables to synchronize request and reply
$response['recordsTotal'] = $recordsTotal;
header('Content-Type: application/json');
echo json_encode($rsp);
exit;
を生成している次のPHPコード、 https://datatables.net/manual/server-side