SQLSRV cannot be connected

Hello Experts,
Please support me as I’m getting crazy,

I want to use dhtmlxConnector_php_v15_120612 with grid example 11_auto_config_filters.html.
I wan to connect it to sql server,
As I understood I just need to change “11_auto_config_filters.php” according to following, nothing else and it will work, But It was not successful.
Please support.
11_auto_config_filters.php :

<?php require("../../codebase/grid_connector.php"); require("../../codebase/db_sqlsrv.php"); $serverName = '172.26.7.65\ATOLL'; $myDB = 'DUMP'; $myUser = 'sa'; $myPass ='admin'; $connectionInfo = array( "Database"=>$myDB, "UID"=>$myUser, "PWD"=>$myPass); $conn = sqlsrv_connect( $serverName, $connectionInfo); $grid = new GridConnector($conn,"SQLSrv"); $grid->set_config(true); $grid->dynamic_loading(100); $grid->render_table("RL_C_ALL","NAME","Family"); ?>

I found the issue, sqlsrv extension for php needs to be downloaded and to be activated.
websvn.projects.ez.no/wsvn/mssql … ion&rev=9&

now I can see the connected grid to sqlserv but the issue is just one column is showing in grid.
for example “render_table(“RL_C_ALL”,“NAME”,“Family”);” is showing family in grid
and render_table(“RL_C_ALL”,“Family”,“Name”); is showing Name in grid

What is the issue??? I want to see both of them???
and one more thing if I want to show one special query like as joint tables or… how can I see them in grid with php-connector??
thanks a lot.

Actually I need some example about render_sql.
Please support.
Thanks in advance.

Is there any support??
This one is working properly:
$grid->render_table(“RL_C_ALL”,“Family, NAME”,“Family, Name”);

but following is not working:
$grid->render_table(“RL_C_ALL”);

And also following is not working :
$grid->render_sql("select * from RL_C_ALL where NAME=‘JOHN’ ");

where is my problem??

The correct syntax is

render_table(“RL_C_ALL”,“NAME, Family”);

all fields must be defined in the second parameter of render method

As for custom sql query - you can use render_sql or render_complex_sql with syntax similar to render_table, just replace table name with SQL code which you want to execute

( render_sql may fail for some complex SQL instructions, render_complex_sql will work for any valid SQL )

Dear stanislav,
please check my latest post,
As I understood, If I want to show whole table I should use:
$grid->render_table(“RL_C_ALL”);
but itis not working,

And also following sql is not working :
$grid->render_sql("select * from RL_C_ALL where NAME=‘JOHN’ ");

where is my problem??
Thanks alot.

In both cases it is better to provide full list of fields which you want to see

$grid->render_table(“RL_C_ALL”, “id”, “fieldA, fieldB, fieldC”);
or
$grid->render_sql("select * from RL_C_ALL where NAME=‘JOHN’ ", “id”, “fieldA, fieldB, fieldC”);

where id - name of field that will be used as record id
fieldA…fieldC - fields which you want to see in the grid

Dear,
This is not good at all.
I have 21 tables with so many columns,
I want that it gets a name of table from user and shows all columns of table.
Please support me in server side to have this.
This static way is not good.
Thanks in advance.
Br
Beniy

Dear,
This is not good at all. I have 21 tables and each one has so many columns that I want to get the table name from users and show all the columns of the table.
Please support me to have this in server side if that’s possible to have this with this connector.
the static way to mention all the column name is not good at all.
Thanks in advance.
Br Beniy

If you need to have automatic data saving then you need to provide the id ( second parameter ), without it connector will work in readonly mode.

As for list of fields - it is depends on DB driver, it will work MySQL for example, but is not guaranteed for all other data drivers, so it better to provide the list of fields directly.

Dear Stanislav,
I’m using SQl and it’s not working, Can you please guide me that how can I handle it!
Something like following will work??

$colName = mssql_num_fields($result);
for ($j=1; $j<= $colName; $j++)
{
$grid->render_table(“RL_C_ALL”, mssql_field_name ($result, $j ));
}

I think it must be similar to the next

$colName = mssql_num_fields($result); 
$names = array();
for ($j=1; $j<= $colName; $j++) 
    $names[] = mssql_field_name ($result, $j );

$grid->render_table("RL_C_ALL", "id", implode(",", $names) );