A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/DevExpress/DevExtreme-PHP-Data below:

DevExpress/DevExtreme-PHP-Data: DevExtreme data layer extension for PHP

This library is intended for loading data from a MySQL (mysqlnd is required) database, based on expressions passed from a client by a DevExtreme data source. The library will allow you to implement a data service that supports the protocol described in the following help topic: Custom Data Sources.

Moreover, the library will allow you to perform all operations such as, filtering, sorting, paging and grouping on the server side.

NOTE This library is for demonstrative purposes only. It illustrates how to use PHP to process client requests on the server. If the current functionality does not meet your needs, feel free to fork the repository and modify the source code according to your requirements.

If you wish to load data from a MySQL data table based on parameters received from the client side, perform the following steps.

spl_autoload_register(array("DevExtreme\LoadHelper", "LoadModule"));

Since all classes in the library are wrapped in the DevExtreme namespace, use the use operator to get rid of long names in your code. Only two classes are required: DbSet and DataSourceLoader. Execute the following code to be ready to use these classes:

use DevExtreme\DbSet;
use DevExtreme\DataSourceLoader;

To load data, perform the following steps.

$mySQL = new mysqli("serverName", "userName", "password", "databaseName");
$dbSet = new DbSet($mySQL, "tableName");
$result = DataSourceLoader::Load($dbSet, $params);

Note that parameters ($params) must be passed as an associative array.

That's it. The $result variable will contain the required results. It will represent an array of items. If you wish to send it to the client to be dislplayed in a DevExtreme widget, convert it to the JSON format. You can use the json_encode function for this task.

The example folder of this repository contains an example that shows how to use the library. To test it:

The DbSet class has the following public methods that you can use without using the DataSourceLoader class.

$dbSet->Delete(array("ID" => 1));

The method returns a number of the affected rows.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4