Cannot get data to be displayed in grid

I’m not sure what I did wrong. The empty table appears correctly. But the data in the db won’t show.
This is my code:


<!DOCTYPE html>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link rel="STYLESHEET" type="text/css" href="../dhtmlx/dhtmlxGrid_v45_std/codebase/dhtmlxgrid.css">
    <script src="../dhtmlx/dhtmlxGrid_v45_std/codebase/dhtmlxgrid.js"></script>

    <div id="gridbox" style="width:500px;height:400px;"></div>  

        mygrid = new dhtmlXGridObject('gridbox');
                //the path to images required by grid 
        mygrid.setHeader("Task");//the headers of columns  
        mygrid.setInitWidths("250,250");          //the widths of columns  
        mygrid.setColAlign("right,left");       //the alignment of columns   
        mygrid.setColTypes("ro,ed,ed,ed");                //the types of columns  
        mygrid.setColSorting("int,str,str,int");          //the sorting types   
        mygrid.init();      //finishes initialization and renders the grid on the page 



and in the same folder:

require_once("../dhtmlx/dhtmlxConnector_php_v15_120612/codebase/grid_connector.php");//includes related connector file

$res=mysql_connect("here I filled in the 'host name' of my MySQL db on my server","here I filled in the db username","here I filled in the db password"); //connects to server containing the desired DB
mysql_select_db("here I filled in the db name");           //connects to DB.'sampledb' is the name of our DB
$conn = new GridConnector($res,"MySQL");                    // connector initialization
$conn->render_table("todolist","ID","Task");  // 'todolist' is the table name.


Can anyone help me out? Cheers!

Change the server side code like follows

$conn = new GridConnector($res,“MySQL”);
$conn->render_table(“todolist”,“ID”,“Task”); // ‘todolist’ is the table name.

as a result, the log.txt file will be created when you will run a script next time. The log will contain an additional info about the request processing ( be sure that script’s folder is not write-protected )

Dear Stanislav,
Thank you for your answer.
I added the line to my connector.php file, but I’m not sure how to “run a script”. When I opened my page, I guess it tries connecting so I was expecting the log to be created then, but there was no log made…
This is my page currently:

Any ideas?

Luca Ban

Please check that PHP have a write acess for the script’s folder

I have checked the link, and it works correctly. The server side returns an empty data set. Are you sure that “todolist” table has some records?

I just found the bug.

This part:
had double apostrophes: " "

but my password starts with $ so it was not seen as a password.
when changing everything to single apostrophes: ’ ’ it worked!

I had no idea there was a difference between " " and ’ ’ …