What's wrong in my code?

[code]require(‘codebase/connector/grid_connector.php’);
require(‘codebase/connector/options_connector.php’);

$connessione=mysql_connect($mysql_server, $mysql_user, $mysql_password);
mysql_select_db($mysql_database);

$grid = new GridConnector($connessione,“MySQL”);
$grid->set_options(“IdCausaleCont”, array(“1” => “47”));
$grid->render_table($mysql_table,“id”,“Cfm,Sottoconto,DareAvere,IdCausaleCont”);[/code]

This code load all data, not only the selected (with IdCausaleCont = “47”).

set_options is used to define collection of options for grid or scheduler, it can’t be used for data filtering.

You can change your code as

$grid->render_table("Select * from $mysql_table where IdCausaleCont = 4","id","Cfm,Sottoconto,DareAvere,IdCausaleCont");

This code produce this query:

SELECT id,Cfm,Sottoconto,DareAvere FROM SELECT * FROM contropartite WHERE IdCausaleCont = 48;

Are you sure that it’s correct? Mysql have another idea about query… :wink:

change
$grid->render_table
to the
$grid->render_sql

If i use render_sql the dataprocessor change the id of the row and it’s bad!

change the id of the row and it’s bad!
Can you provide some more details?

I’ve found the problem. The field name is case sensitive. If i use ID is different from id (for DHTMLX, not for MySQL)