Problem with subqueries and Connectors V1.0

Hello, I try to use a subqueries with dhtmlxGridConnector.

I saw on a post that i have to use vers. 1.0, so i installed it, but it not works better …

[code]<?php
require_once("…/dhtmlxConnector_NEW/codebase/grid_connector.php");
include("…/…/var.php");
$pid = $_GET[‘palier’];
$auj = date(‘Y-m-d’);

$req = “SELECT alliances.id as AId, concat(projets.nom,’ ‘,projets.commentaire,’ ‘,alliances.commentaire) as PROJET, concat(hostname,’ ',ip) as SERVEUR , plateformes.datedebut, plateformes.datefin, (select count(*) FROM plateformes p WHERE p.alliance = alliances.id AND ‘$auj’ between p.datedebut and p.datefin) as mut FROM plateformes, alliances, serveurs, projets WHERE plateformes.palier = $pid AND plateformes.alliance = alliances.id AND alliances.serveur = serveurs.id AND alliances.projet = projets.id ORDER BY PROJET ASC”;

$grid = new GridConnector($conn);
$grid->render_sql($req, ‘AId’,‘AId,mut,PROJET,SERVEUR,datedebut,datefin’, ‘’, ‘’);

?>[/code]

I’ve tried with a simple select, and i have the same error : Incorrect XML.
When I tried to display the connector page, instead of having the xml, i’ve got :

Object id #7

strange no ?
seams to have a problem with function OutputWritter in base_connector.php …

(sorry for this post, i’m french and not very fluent in english …)

thanks for help me

marion.

more informations :

i have installed my code on a pc - windows (it’s an intranet website, i use wampserver and a mysqlbase) : it’s works !

i’ve got the problem only on the server : it’s installed on a linux server, with apache.

an idea ?

marion

Try to enable server side logging and check what issues will it has
docs.dhtmlx.com/doku.php?id=dhtm … nd_logging

i’ve done it :

with and without subqueries :

[code]====================================
Log started, 05/08/2010 01:08:56

SELECT alliances.id as AId, concat(projets.nom,’ ‘,projets.commentaire,’ ‘,alliances.commentaire) as PROJET, concat(hostname,’ ',ip) as SERVEUR , plateformes.datedebut, plateformes.datefin, hostname as mut FROM plateformes, alliances, serveurs, projets WHERE plateformes.palier = 11 AND plateformes.alliance = alliances.id AND alliances.serveur = serveurs.id AND alliances.projet = projets.id ORDER BY PROJET ASC,datefin DESC

Done in 0.0042588710784912s

====================================
Log started, 05/08/2010 01:08:45

SELECT alliances.id as AId, concat(projets.nom,’ ‘,projets.commentaire,’ ‘,alliances.commentaire) as PROJET, concat(hostname,’ ',ip) as SERVEUR , plateformes.datedebut, plateformes.datefin, (select count(*) FROM plateformes p WHERE p.alliance = alliances.id AND ‘2010-08-05’ between p.datedebut and p.datefin) as mut FROM plateformes, alliances, serveurs, projets WHERE plateformes.palier = 11 AND plateformes.alliance = alliances.id AND alliances.serveur = serveurs.id AND alliances.projet = projets.id ORDER BY PROJET ASC,datefin DESC

Done in 0.0064570903778076s[/code]

and always the same error : Incorrect XML

Marion

Try to attach dhtmlxcommon_debug.js file to your page and provide error message which you will see at pop up alert.

i don’t find this js file … where is it ?

dhtmlxGrid\codebase\dhtmlxcommon_debug.js
or
dhtmlxGrid\sources\dhtmlxcommon_debug.js

Maybe it’s too early in the morning … i have downloaded the latest zip of dhtmlxgrid, i have downloaded the Complete Suite zip … and i still haven’t found (what i’m looking for :slight_smile: :slight_smile: )

I’ve just found : dhtmlxDataProcessor/codebase/dhtmlxdataprocessor_debug.js
But not dhtmlxcommon_debug.js …

Sorry

You can download debug version of dhtmlxcommon.js here support.dhtmlx.com/x-files/docum … _debug.zip

When I tried to display the connector page, instead of having the xml, i’ve got :
Object id #7

Please check if any additional information is being passed to the stdin. Do you have any debug info at var.php file.
Also check if $conn really exists at the moment of GridConnector initialization

Thanks for your help.

The debug.js display this :

XML error : Non valide au niveau supérieur du document.
Loading : ./dhtmlxGrid/connectors/myConnectorPhotoPlateforme.php ?palier=20&a_dhx_rSeed=1281437987700
Status: 200
Response: Object id #7[/code]


And if I use the previous version of dhtmlxConnector : 
[code]Loading: ./dhtmlxGrid/connectors/myConnectorPhotoPlateforme.php ?palier=20&a_dhx_rSeed=1281438473153
Status: 200
Response: <rows id=’162><cell><![CDATA[162]]</cell><cell>….

I found nothing in the logs file, nothing in the stdin

Maybe the new version of dhtmlxConnector works with a special version of dhtmlxgrid ? or other ? no ?

I have the same error using subqueries or no.

thanks
marion

Which version of php you are using?

Please try to update existing file with attached one, possible reasons of the problem was fixed.
( still it seems as valid code for php 5.x )
base_connector.zip (5.22 KB)

whaou, thanks ! it works ! and with subqueries too … merci !
for info i use php v5.1.6

What was the problem ?

Marion

Code uses __toSting method , which normally automatically applied, when object need to be serialized as the string. But after extra investigation, it occurs that prior PHP 5.2 it didn’t work correctly ( not auto executed )

Patched file triggers serialization by direct method call, which fixes issue. ( we will add the same fix to the main version of connector )