Aggrid Php Example Updated __full__ -

$countSql = "SELECT COUNT(*) as total FROM products $where"; $totalRows = $pdo->query($countSql)->fetch(PDO::FETCH_ASSOC)['total']; $sql = "SELECT id, name, price FROM products $where $orderBy LIMIT $startRow, $limit"; $stmt = $pdo->query($sql); $rows = $stmt->fetchAll(PDO::FETCH_ASSOC); echo json_encode([ 'success' => true, 'rows' => $rows, 'lastRow' => $totalRows ]); catch(PDOException $e) echo json_encode(['success' => false, 'error' => $e->getMessage()]);

npm install ag-grid-community