DHTMLX Docs & Samples Explorer

The init code are similar for all components and DB types

#### DB types

MySQL ( php_mysql )

    require("connector/grid_connector.php");

    $res=mysql_connect("localhost","root","");
    mysql_select_db("myDatabase");

    $gridConn = new GridConnector($res,"MySQL");

MySQLi ( php_mysqli )

    require("connector/grid_connector.php");
    require("connector/db_mysqli.php");

    $mysqli = new mysqli($server, $user, $pass, $mysql_db);
    $gridConn = new GridConnector($mysqli,"MySQLi");

PostgreSQL ( php_pg )

    require("connector/grid_connector.php");
    require("connector/db_postgre.php");

    $res = pg_connect("host=localhost port=5432 dbname=mary");

    $gridConn = new GridConnector($res,"Postgre");

Oracle ( php_oci )

    require("connector/grid_connector.php");
    require("connector/db_oracle.php");

    $res = oci_connect("scott", "tiger", $db);

    $gridConn = new GridConnector($res,"Oracle");

MSSQL ( php_mssql )

    require("connector/grid_connector.php");
    require("connector/db_mssql.php");

    $res=mssql_connect('.\SQLEXPRESS',"sa","1",false);
    mssql_select_db("sampleDB");

    $gridConn = new GridConnector($res,"MsSQL");

PDO ( php_pdo )

    require("connector/grid_connector.php");
    require("connector/db_pdo.php");

    $res = new PDO('mysql:host=localhost;dbname=test', $user, $pass);

    $gridConn = new GridConnector($res,"PDO");

File System

    require("connector/grid_connector.php");
    require("connector/db_pdo.php");

    $gridConn = new GridConnector("/var/www/test","FileSystem");
    $grid->render_table("./", "id", "A,B,C,D,E,F");

Excel file

    require("connector/grid_connector.php");
    require("connector/db_excel.php");

    $res = new PDO('mysql:host=localhost;dbname=test', $user, $pass);

    $grid = new GridConnector("some.xls", "ExcelDBDataWrapper");
    $grid->render_table("A18:F83", "id", "A,B,C,D,E,F");

#### Component types

For other components syntax of constructor exactly the same, except, the “Grid” in object name replaced with component's name

Grid

         require("connector/grid_connector.php");
         //...
         $gridConn = new GridConnector($res,"MySQL");

TreeGrid 1)

         require("connector/treegrid_connector.php");
         //...
         $treeGridConn = new TreeGridConnector($res,"MySQL");

Tree 2)

         require("connector/tree_connector.php");
         //...
         $treeConn = new TreeConnector($res,"MySQL");

Combo

         require("connector/combo_connector.php");
         //...
         $comboConn = new ComboConnector($res,"MySQL");

Scheduler

         require("connector/scheduler_connector.php");
         //...
         $schedulerConn = new SchedulerConnector($res,"MySQL");

Form

         require("connector/form_connector.php");
         //...
         $formConn = new FormConnector($res,"MySQL");

DataView

         require("connector/dataview_connector.php");
         //...
         $dataConn = new DataViewConnector($res,"MySQL");

Chart

         require("connector/chart_connector.php");
         //...
         $chartConn = new ChartConnector($res,"MySQL"); // (!!!)

1) , 2) check configuration details