RazorFlow DataSource

Connecting to MySQL DataSource:

To connect to a MySQL DataSource, create a DataSource object like this:

$dataSource = new MySQLDataSource('databaseName', 'username', 'password', 'localhost');
$dataSource->setSQLSource('TableName');

Performing JOINs on a Query

To perform a JOIN on a query, specify it like this while setting the SQL Source

$dataSource->setSQLSource('Table1 JOIN Table2 ON Table2.id = Table1.id');

Using Subqueries in a DataSource

You can use a subquery as a DataSource, like this.

$dataSource->setSQLSource(‘(SELECT * FROM Table1) AS sub_query’);

Sample DataSource

In order to make RazorFlow PHP easy to understand and experiment with, RazorFlow PHP comes with a pre-installed Sample SQLite Database. To get a new instance of the Sample Datasource, simply call:

$dataSource = RFUtil::getSampleDataSource();

Now, you can use the $dataSource variable in any component.

Start building interactive, mobile-friendly Dashboards in PHP. See DemosDownload