Hi, I am trying to load a tree from a database table and am unable to see the data onscreen. I do not see any error messages. I am a novice with php and DHTMLX.
Thanks for any help you can give.
here is my code: main.php
var tree = new dhtmlXTreeObject("treebox", "100%", "100%", 0);
tree.enableDragAndDrop(true);
tree.setSkin("dhx_terrace");
tree.attachEvent("onDrag", function() { return false; });
tree.setImagePath("//cdn.dhtmlx.com/edge/imgs/dhxtree_material/");
tree.load("./data/tree.php");
tree.php file
include ('../common/config.php');
include ('../common/connector/db_mysqli.php');
$tree = new schedulerConnector($res, $dbtype);
$tree->render_table("details_table","id","country_id","state_id","city_id","town_name");
ED. In console I see this error in my tree.php file. Still can’t figure out.
Fatal error: Uncaught Exception: MySQL operation failed
Unknown column ‘’ in ‘where clause’ in SOME_PATH\tree\common\connector\db_mysqli.php:14
Stack trace: #0 SOME_PATH\tree\common\connector\db_common.php(755): MySQLiDBDataWrapper->query(‘SELECT id,`co…’) #1 SOME_PATH\tree\common\connector\strategy.php(174): DBDataWrapper->select(Object(DataRequestConfig)) #2 SOME_PATH\tree\common\connector\base_connector.php(663): TreeRenderStrategy->render_set(Object(mysqli_result), ‘TreeDataItem’, NULL, ‘\n’, Object(DataConfig), Array) #3 SOME_PATH\tree\common\connector\base_connector.php(671): Connector->render_set(Object(mysqli_result)) #4 SOME_PATH\htdocs\XXXXXXX\dhtmlxSchedu in SOME_PATH\tree\common\connector\db_mysqli.php on line 14
As you see in my render-sql there is no where clause, I can not see where it would add one to it.
I get this error when I Preview the tree.php in the browser.
SELECT id,country_id,baseline_id,course_id, Concat(topic_number, , topic_title) as TopicTitle FROM country_baseline_course_topic_details WHERE ( = '0' OR IS NULL )
Fatal error: Uncaught Exception: MySQL operation failed Unknown column ’ ’ in ‘field list’ in F:\some path…\db_mysqli.php:17 Stack trace:
===============
Tree.php
<?php
require_once('../common/connector/tree_connector.php');
require_once('../common/connector/scheduler_connector.php');
include ('../common/config.php');
include ('../common/connector/db_mysqli.php');
$tree_db = new treeConnector($res, $dbtype);
$result = $tree_db->render_sql("Select `id`,`country_id`,`baseline_id`,`course_id`, Concat(`topic_number`, ` `, `topic_title`) as `TopicTitle`
from country_baseline_course_topic_details","TopicID","CountryID, CountryTitle, BaselineID, BaselineTitle, CourseID, CourseTitle, TopicTitle");
===============
RonTest_outer_drag.php
===============
Integration with dhtmlxTree
html, body {
margin: 0px;
padding: 0px;
height: 100%;
overflow: hidden;
}
#scheduler_here {
background-color: white;
border-left: 1px solid #EBE9E9;
border-right: 1px solid #EBE9E9;
}