function bagiankit()
{
$page = isset($_POST['page']) ? intval($_POST['page']) : 1;
$rows = isset($_POST['rows']) ? intval($_POST['rows']) : 10;
$offset=($page-1)*$rows;
$result=array();
$sqlcount = "SELECT count(*) as total FROM bagian ";
$sqlc = mysql_query($sqlcount);
$rowo = mysql_fetch_row($sqlc);
$result['total'] = $rowo[0];
$sqlData = "SELECT * FROM bagian ORDER BY ID_BAGIAN DESC LIMIT $offset,$rows";
$query = mysql_query($sqlData);
$rows=array();
while ($row = mysql_fetch_object($query)) {
array_push($rows, $row);
}
$result['rows'] = $rows;
return json_encode($result);
}
Tidak ada komentar:
Posting Komentar