What is the best PHP mssql pagination class? #mssql pagination
Edit
by DONGGYUN KIM - 4 years ago (2020-08-13)
Example mssql pagination with php
| I would like to perform queries to a Microsoft SQL server and retrieve the results to be displayed in a paginated listing. |
Ask clarification
2 Recommendations
PHP PDF Table using FPDF: Generate PDF documents with tables displaying data
This class can generate PDF documents with tables displaying data.
It is an extension of the FPDF that takes arrays with data to display on the rows of a table and then it can generate a PDF document that displays the table on a page.
The class allows to configure the orientation of the table on the page. Other attributes can be set using functions of the FPDF base class.
| by Stefan Kientzler package author 425 - 4 years ago (2020-08-16) Comment
With simple DB access (like Manuel, I also recommend doing this via PDO ...) and with this package, you can define any PDF reports that list the retrieved data according to your requirements. You can define the page format (portrait, landscape, size), column headings, and the columns you want to display. If necessary, the display of the total (including subtotal / transfer) can be defined for numeric columns.
Just look at the example that is included in the package and replace the 'dataloop' with something like
$dsn = "sqlsrv:Server=YourSQLServer;Database=YourDatabase";
$pdo = new PDO($dsn, "Username", "Password");
foreach ($pdo->query("SELECT * FROM tUser") as $row) {
$pdf->Row($row);
}
|
This class can access databases using PDO.
It uses the singleton pattern to establish a single database connection to a given database using PDO and executes several types of operations to store and retrieve information in that database.
Currently it can execute execute arbitrary or action queries composed from parameters that are included in prepared statements.
The class can also composed and execute queries to INSERT, UPDATE, DELETE records, or get the first or last rows of a SELECT query.
| by Manuel Lemos 26695 - 4 years ago (2020-08-15) Comment
Nowadays is better to use the PDO extension for instance with a package like this to display paginated results to a many databases including Microsoft SQL server. |