Hi
My dhtmlxtree and dhtmlxconnector scripts were working perfectly on WinXP & Apache machine. But when I moved the scripts to Linux hosting, I got the following error.
The connector.php script was supposed to show the xml tags as below
<tree id="0">
<item id="0#19" text="Balaka" child="1" im0="folderClosed.gif" im1="folderOpen.gif" im2="folderClosed.gif"/>
<item id="0#3" text="Blantyre" child="1" im0="folderClosed.gif" im1="folderOpen.gif" im2="folderClosed.gif"/>
<item id="0#13" text="Chikwawa" child="1" im0="folderClosed.gif" im1="folderOpen.gif" im2="folderClosed.gif"/>
<item id="0#12" text="Chiradzulu" child="1" im0="folderClosed.gif" im1="folderOpen.gif" im2="folderClosed.gif"/>
<item id="0#23" text="Chitipa" child="1" im0="folderClosed.gif" im1="folderOpen.gif" im2="folderClosed.gif"/>
<item id="0#8" text="Dedza" child="1" im0="folderClosed.gif" im1="folderOpen.gif" im2="folderClosed.gif"/>
<item id="0#7" text="Dowa" child="1" im0="folderClosed.gif" im1="folderOpen.gif" im2="folderClosed.gif"/>
<item id="0#25" text="Karonga" child="1" im0="folderClosed.gif" im1="folderOpen.gif" im2="folderClosed.gif"/>
<item id="0#6" text="Kasungu" child="1" im0="folderClosed.gif" im1="folderOpen.gif" im2="folderClosed.gif"/>
<item id="0#5" text="Lilongwe" child="1" im0="folderClosed.gif" im1="folderOpen.gif" im2="folderClosed.gif"/>
<item id="0#27" text="Machinga" child="1" im0="folderClosed.gif" im1="folderOpen.gif" im2="folderClosed.gif"/>
<item id="0#28" text="Mangochi" child="1" im0="folderClosed.gif" im1="folderOpen.gif" im2="folderClosed.gif"/>
<item id="0#1" text="Mchinji" child="1" im0="folderClosed.gif" im1="folderOpen.gif" im2="folderClosed.gif"/>
<item id="0#14" text="Mulanje" child="1" im0="folderClosed.gif" im1="folderOpen.gif" im2="folderClosed.gif"/>
<item id="0#11" text="Mwanza" child="1" im0="folderClosed.gif" im1="folderOpen.gif" im2="folderClosed.gif"/>
<item id="0#2" text="Mzimba" child="1" im0="folderClosed.gif" im1="folderOpen.gif" im2="folderClosed.gif"/>
<item id="0#30" text="Mzuzu" child="1" im0="folderClosed.gif" im1="folderOpen.gif" im2="folderClosed.gif"/>
<item id="0#29" text="National" child="1" im0="folderClosed.gif" im1="folderOpen.gif" im2="folderClosed.gif"/>
<item id="0#10" text="Neno" child="1" im0="folderClosed.gif" im1="folderOpen.gif" im2="folderClosed.gif"/>
<item id="0#22" text="Nkhatabay" child="1" im0="folderClosed.gif" im1="folderOpen.gif" im2="folderClosed.gif"/>
<item id="0#21" text="Nkhotakota" child="1" im0="folderClosed.gif" im1="folderOpen.gif" im2="folderClosed.gif"/>
<item id="0#17" text="Nsanje" child="1" im0="folderClosed.gif" im1="folderOpen.gif" im2="folderClosed.gif"/>
<item id="0#9" text="Ntcheu" child="1" im0="folderClosed.gif" im1="folderOpen.gif" im2="folderClosed.gif"/>
<item id="0#26" text="Ntchisi" child="1" im0="folderClosed.gif" im1="folderOpen.gif" im2="folderClosed.gif"/>
<item id="0#15" text="Phalombe" child="1" im0="folderClosed.gif" im1="folderOpen.gif" im2="folderClosed.gif"/>
<item id="0#24" text="Rumphi" child="1" im0="folderClosed.gif" im1="folderOpen.gif" im2="folderClosed.gif"/>
<item id="0#20" text="Salima" child="1" im0="folderClosed.gif" im1="folderOpen.gif" im2="folderClosed.gif"/>
<item id="0#16" text="Thyolo" child="1" im0="folderClosed.gif" im1="folderOpen.gif" im2="folderClosed.gif"/>
<item id="0#18" text="Zomba" child="1" im0="folderClosed.gif" im1="folderOpen.gif" im2="folderClosed.gif"/>
</tree>
here is the source code of connector.php . I would appreciate if anyone can help me with this error. Thanks in advance.
[code]<?php
include_once(“include/library.php”);
$res=mysql_connect($dbLocalAry[‘host’],$dbLocalAry[‘user’],$dbLocalAry[‘password’]);
mysql_select_db($dbLocalAry[‘dbname’]);
require("dhtmlxconnector/treemultitable_connector.php");
$tree = new TreeMultitableConnector($res);
$tree->setMaxLevel(3);
$level = $tree->get_level();
function format_district($item)
{
$item->set_image("folderClosed.gif","folderOpen.gif","folderClosed.gif");
}
function format_ta($item)
{
$item->set_image("y_folderClosed.gif","y_folderOpen.gif","y_folderClosed.gif");
}
function format_gvh($item)
{
$item->set_image("b_folderClosed.gif","b_folderOpen.gif","b_folderClosed.gif");
}
if ($_SESSION[PREFIX.'Level']==LEVEL_DISTRICT)
$sql="select * from district where ID=".$_SESSION[PREFIX.'DistrictID'];
else
$sql="select * from district order by NAME ASC";
switch ($level) {
case 0:
$tree->event->attach("beforeRender",format_district);
$tree->render_sql($sql,"ID","NAME","","");
break;
case 1:
$tree->event->attach("beforeRender",format_ta);
$tree->render_sql("SELECT * from ta order by NAME ASC", "ID", "NAME", "", "DISTRICT_ID");
break;
case 2:
$tree->event->attach("beforeRender",format_gvh);
$tree->render_sql("SELECT * from gvh order by NAME ASC", "ID", "NAME", "", "TA_ID");
break;
case 3:
$tree->render_sql("SELECT * from vh order by NAME ASC", "ID", "NAME", "", "GVH_ID");
break;
}
?>[/code]