When change grid content => incorrect XML message (MySQL)

Hi folks

I’m just starting working with DHTMLX from a friend advice.

My first try is to have a simple grid linked with a MySQL database.

I had setup a grid that displays a table content successfully.

But now, as soon as I try either to:

  • modify a cell content
  • use the “add” button to add a new line

I am getting a “Load XML error” with “Incorrect XML” information, and no update in my database.

Here are my script and data connector contents:

[code] [/code]

AdherentConnector.php Data connector :

[code]<?php
// gestion de la base de données
require_once(“./config.php”);
require_once (“…/js/dhtmlxConnector_php/codebase/grid_connector.php”);
$res=mysql_connect($mysql_server,$mysql_user,$mysql_pass);
mysql_select_db($mysql_db);

    // définition de la connection
    $gridConn = new GridConnector($res,"MySQL");
    $gridConn->enable_log("../log/CategorieConnector.log");
    $gridConn->dynamic_loading(400);

    // mise en place du connecteur
    $gridConn->render_table("adherent", "id_adherent", "Nom,Prenom");

    // deconnection
    mysql_close($res);

?>[/code]

Behavior can be tested here : ks369381.kimsufi.com/hebergement … rents.html

Could you please give me a hand in order to solve my problem ?

Regards
Matt

It seems that dataprocessor returns invalid XML data, which results in the alert message.

To fix the issue - add one more include on the page

where connector.js can be taken from connector’s package.

Hi

I added in my main HTML file the following under dhtmlx.js call:

<script src="js/dhtmlxConnector_php/codebase/connector.js"></script>

and it solved the problem. Thanks !

Is the problem coming from a mistake I made (i.e. not correctly reading samples/documentation) or adding this connector.js is a work around to what may looks like a bug ?

Matt

I think it is mentioned in documentation.

The client side code is perfectly valid without connector js, but you need to use a custom code on server side. To use connector for CRUD operations - connector.js must be included on the client side.

Hi !

OK, then sorry to have took you time in a useless manner if it is a mistake from my side…

DHTMLx is so huge and capable than it is sometimes difficult to find the good example to start from :slight_smile:

Matt