dhtmlx grid - populate with MySQL

I am having trouble using the dhtmlx grid:  http://docs.dhtmlx.com/doku.php?id=dhtmlxgrid:toc

I am looking for someone who has used it with MySQL.  I have gotten closer to where I can get the column headers to display, but no data.

When I open gridData.php directly I get:
This XML file does not appear to have any style information associated with it. The document tree is shown below.
<column type="ro" width="100">Dealer</column>
<column type="ro" width="100">Web Appts</column>
<column type="ro" width="100">Show Rate</column>
<column type="ro" width="100">Total Appt Set</column>
<column type="ro" width="100">Web Show #</column>
<column type="ro" width="100">Total RO $</column>
<column type="ro" width="100">Market</column>
<column type="ro" width="100">Period</column>
<row id="1390272345x0">
<![CDATA[ Toyota Town ]]>
<![CDATA[ 110 ]]>
<![CDATA[ 55.7 ]]>
<![CDATA[ 201 ]]>
<![CDATA[ 56 ]]>
<![CDATA[ 173943 ]]>
<![CDATA[ WE1 ]]>
<![CDATA[ 01/2013 ]]>

Open in new window

here is my gridData.php
require("dhtmlxGrid/dhtmlxConnector/codebase/grid_config.php");// connector file
require("dhtmlxGrid/dhtmlxConnector/codebase/grid_connector.php");// connector file

//get fields to display on grid
    $delim = "";
    $sql = "SELECT * FROM selectedfields ORDER BY sortOrder" ;
    $res = mysql_query($sql);
    if (!$res) die( mysql_error() );
    while($row = mysql_fetch_assoc($res))
        $fields .= $delim .  $row["fieldName"]  ;
        $delim = ",";

$gridConn = new GridConnector($db_connection,"MySQL"); // connector object;    parameters: db connection and the type of the using db
$gridConn->set_config(new GridConfiguration());
$gridConn->render_table("dealerdata","",$fields,"");// data configuration 

Open in new window

and here is my page to display the grid (displayData.php)
     <link rel="STYLESHEET" type="text/css" href="dhtmlxGrid/codebase/dhtmlxgrid.css">
     <script src="dhtmlxGrid/dhtmlxConnector/codebase/connector.js"></script>
     <script src="dhtmlxGrid/codebase/dhtmlxcommon.js"></script>
     <script src="dhtmlxGrid/codebase/dhtmlxgrid.js"></script>
     <script src="dhtmlxGrid/codebase/dhtmlxgridcell.js"></script>
        var mygrid;
        function doInitGrid(){
            mygrid = new dhtmlXGridObject('mygrid_container');
            //mygrid.setHeader("Name,Last Name,Department");//specifies the grid's headers
  <body onload="doInitGrid()">
        <div id="mygrid_container"></div>

Open in new window

Again, in displayData.php I am only getting the column headings, no data is displaying.

Thanks in advance for your help.
Who is Participating?
Eddie ShipmanConnect With a Mentor All-around developerCommented:
I'd suggest following the example here: http://docs.dhtmlx.com/doku.php?id=dhtmlxdatastore:datastore_example_server-side

I don't think you are setting up your connector correctly.
KCTechNetAuthor Commented:
that example is using the dataStore.  I just need the dataGrid and it looks like  I just need the connector since I don't need the data to be edited.  

I am using http://docs.dhtmlx.com/doku.php?id=tutorials:dhtmlxgrid_serverside for help, but I am just not seeing what I am doing wrong.
KCTechNetAuthor Commented:
Or if there is another free grid that others have had experience with I don't mind trying something else.
KCTechNetAuthor Commented:
currently checking out trirand's product:  http://www.trirand.net/demo/php/jqgrid/

hope to get that working because it seems pretty flexible and easy to configure.
KCTechNetAuthor Commented:
i was able to get Trirand's product to work.  Thanks for your time
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.