Problems with field named index in render_table

I am a bit baffled over an issue that is holding me up from moving forward with learning more about this environment.

I cannot find any documentation that identifies any “reserved” words for functions such as render_table. Yet, I cannot use a render_table that includes an id (the second attribute) of “index”. If I do, I receive a popup error that is blank. If i add tildes before and after it will load data but the index is some other long random number followed by an x and the index value from my database. If I substitute another field ie employee_number, works fine.

Ireally don’t want to rework all of my existing code and tables to change the name from index to index_id or something else. I would really like to know if index is a reserved word and there is now way around it or am I missing something easier here?

I’m running this on a Ubuntu 11.04 server with Apache 2, PHP5, MySql 5.1.58.

Although I have never experineced a problem with a table field name of ‘index’ I have read some information elsewhere on the web that it is not a recomneded practice. So, I guess I will be restructuring my project to correct this. If anyone knows of another work around, I would love to hear about it.

Which database you are using?

In case of MySQL and latest connector - all field names must be escaped during sql generation, so there is no limitation.

Latest connector’s codebase is attached.
codebase.zip (60.1 KB)

I’m using MySQL. I have tried several combinations such as :

$formConn = new FormConnector($res);
$formConn->render_table(“ein_users”,“index”,“first_name,last_name,email”);

$formConn = new FormConnector($res);
$formConn->render_table(“ein_users”,"`index`",“first_name,last_name,email”);

$formConn = new FormConnector($res);
$formConn->render_table(“ein_users”,"“index”",“first_name,last_name,email”);

$formConn = new FormConnector($res);
$formConn->render_table(“ein_users”,"index",“first_name,last_name,email”);

The last one lets the Grid load with data but passes the wrong index value to Form.

Executing the next query with latest version of connectors

$form->render_table("ein_users","index","first_name,last_name,email");

results in next sql command

 SELECT `index`,`first_name`,`last_name`,`email` FROM ein_users WHERE `index` = '1'

as you can see all field names are escaped

I get the same problem with the blank popup and no debug message even with the newest connector.js and connector files. I read something about a KeyGridConnector for tables without an ID, so i tried using that as well and i still get the same blank popup.

Can you enable log and check the sql code which is generated by connectors.
Is it wrong in some way? ( you can try to run it directly against DB )

Sounds like a good place to start. Just wasnt sure how to enable that feature.

docs.dhtmlx.com/doku.php?id=dhtm … nd_logging

The logging feature was exactly what i needed. With further testing and adding a PK to the tables i’m editing, everything is now working!! Thanks so much for your help, Great product