DHTMLX Docs & Samples Explorer

Index
dhtmlxDataView

### Connecting to a database

As other, data driven components, dataview can load and save data through connectors

Client side init

       <script src="../../codebase/dhtmlxdataview.js" type="text/javascript"></script>
       <script src="../../connector/dhtmlxdataprocessor.js" type="text/javascript" charset="utf-8"></script>
       <script src="../../connector/connector.js" type="text/javascript" charset="utf-8"></script>

          data.load("php/data.php");

          var dp = new dataProcessor("php/data.php");
          dp.init(data);

Server side init

    <?php
       require_once("../../../connector/dataview_connector.php");

       $conn = mysql_connect("localhost","root","");
       mysql_select_db("dataview");

       $data = new DataViewConnector($conn);
    //table name, ID, list of properties
       $data->render_table("packages_small","Id","Package,Version,Maintainer");
    ?>