Scheduler and Connector issue

I am having a problem with the Scheduler and the Connector. I am trying to fetch data for option lists using the example on this page - docs.dhtmlx.com/doku.php?id=dhtm … ntegration.

The XML seems to be fine. It loads everything and looks good. It lists everything at the bottom under <coll_options for=“team”> and items are

However on the calendar, nothing loads. I get an error in the error log:

[14-Sep-2011 14:42:16] PHP Fatal error: Uncaught exception 'Exception' with message 'PDO - sql execution failed Array' in /mnt/stor1-wc1-dfw1/371140/372644/crm.mosbybuildingarts.com/web/content/includes/dhtmlx/db_pdo.php:14 Stack trace: #0 /mnt/stor1-wc1-dfw1/371140/372644/website/web/content/includes/dhtmlx/db_common.php(619): PDODBDataWrapper->query('SELECT id,id,na...') #1 /mnt/stor1-wc1-dfw1/371140/372644/website/content/includes/dhtmlx/base_connector.php(683): DBDataWrapper->select(Object(DataRequestConfig)) #2 /mnt/stor1-wc1-dfw1/371140/372644/website/content/includes/dhtmlx/scheduler_connector.php(59): OptionsConnector->render() #3 /mnt/stor1-wc1-dfw1/371140/372644/website/web/content/includes/dhtmlx/scheduler_connector.php(69): SchedulerConnector->fill_collections() #4 /mnt/stor1-wc1-dfw1/371140/372644/website/web/content/includes/dhtmlx/base_connector.php(537): SchedulerConnector->xml_end() #5 /mnt/stor1-wc1-dfw1/371140/372644/website in /mnt/stor1-wc1-dfw1/371140/372644/website/web/content/includes/dhtmlx/db_pdo.php on line 14 [14-Sep-2011 14:42:16] PHP Fatal error: Uncaught exception 'Exception' with message 'PDO - sql execution failed Array' in /mnt/stor1-wc1-dfw1/371140/372644/website/web/content/includes/dhtmlx/db_pdo.php:14 Stack trace: #0 /mnt/stor1-wc1-dfw1/371140/372644/website/web/content/includes/dhtmlx/db_common.php(619): PDODBDataWrapper->query('SELECT id,id,na...') #1 /mnt/stor1-wc1-dfw1/371140/372644/website/web/content/includes/dhtmlx/base_connector.php(683): DBDataWrapper->select(Object(DataRequestConfig)) #2 /mnt/stor1-wc1-dfw1/371140/372644/website/web/content/includes/dhtmlx/scheduler_connector.php(59): OptionsConnector->render() #3 /mnt/stor1-wc1-dfw1/371140/372644/website/web/content/includes/dhtmlx/scheduler_connector.php(69): SchedulerConnector->fill_collections() #4 /mnt/stor1-wc1-dfw1/371140/372644/website/web/content/includes/dhtmlx/base_connector.php(537): SchedulerConnector->xml_end() #5 /mnt/stor1-wc1-dfw1/371140/372644/website in /mnt/stor1-wc1-dfw1/371140/372644/website/web/content/includes/dhtmlx/db_pdo.php on line 14

I have no idea what’s causing the error. Here is my PHP code:

scheduler.config.lightbox.sections=[ {name:"description", height:130, map_to:"text", type:"textarea" , focus:true}, {name:"leader", height:23, type:"select", options:scheduler.serverList("team"), map_to:"team_leader"}, {name:"team", height:23, type:"multiselect", options:scheduler.serverList("team"), map_to:"team"}, {name:"time", height:72, type:"time", map_to:"auto"} ]

Before I added the code to pull the option list data, everything worked fine. Anyone know what would cause this?

Thanks

Can you provide a connector configuration?
Some error occurs during db operations and most probably it is caused by invalid connector configuration.

Is this what you’re looking for?

[code]include ‘…/includes/dhtmlx/scheduler_connector.php’;

include ‘…/includes/dhtmlx/db_pdo.php’;

$scheduler = new schedulerConnector($db,“PDO”);

$list = new OptionsConnector($db, “PDO”);
$list->render_table(‘logins’,‘id’,‘id(value),first_name(label)’);

$scheduler->set_options(“team”, $list);

$scheduler->render_table(‘project_schedule’, ‘id’, ‘start_date,end_date,title’);[/code]

a) in your code you are missing one field in the next command
$scheduler->render_table(‘project_schedule’, ‘id’, ‘start_date,end_date,title’);
it must be like
$scheduler->render_table(‘project_schedule’, ‘id’, ‘start_date,end_date,title,team’);

Where team - field in project_schedule which will store foreign key for the logins table

b) if issue still occurs ( most probably it will )

add the next command

$scheduler = new schedulerConnector($db,“PDO”);
$scheduler->enable_log(“log.txt”)

and provide the log file for the problematic operation

I see. I haven’t got that far in hooking up the foreign key. So how would this work if I was using a multiselect? I would need to create another table to create the relationships.

I am still getting the error. I added the $scheduler->enable_log(“log.txt”) but it doesn’t seem to generate anything. The XML file loads file. It’s the calendar page that’s generating the error.

Just checked again and it did create a log file. Here it is:

====================================
Log started, 15/09/2011 07:09:12

SELECT id,start_date,end_date,title,team_leader FROM project_schedule

SELECT id,id as value,first_name as label FROM logins

Done in 0.016268968582153s

Any update on how I can get this working?

if I was using a multiselect
Special crosslink connector is required
docs.dhtmlx.com/doku.php?id=dhtm … ultiselect

Just checked again and it did create a log file. Here it is:
It is quite strange, because log file doesn’t contain any error info, and the server log, which you have provide at the start of discussion do have error records.

Normally, if any DB level error occurs - log file will contain error info.

Well like I said, the XML is generating correctly. It’s the calendar that’s not displaying anything from the XML.

Here’s what I currently have:

[code]

<link rel="stylesheet" href="/css/dhtmlxscheduler_glossy.css" type="text/css" media="screen" title="no title" charset="utf-8">
<script src="/js/dhtmlxscheduler_multiselect.js" type="text/javascript" charset="utf-8"></script>
[/code]

[code]<?
include ‘…/includes/include.php’;
include ‘…/includes/dhtmlx/scheduler_connector.php’;

include ‘…/includes/dhtmlx/db_pdo.php’;

$scheduler = new schedulerConnector($db,“PDO”);
$scheduler->enable_log(“log.txt”);

$list = new OptionsConnector($db, “PDO”);
$list->render_table(‘logins’,‘id’,‘id(value),first_name(label)’);

$scheduler->set_options(“team_leader”, $list);

$scheduler->render_table(‘project_schedule’, ‘id’, ‘start_date,end_date,title’, ‘team_leader’);
?>[/code]

The XML output:

[code]

<start_date>

</start_date>
<end_date>

</end_date>

[/code]

Figured out the problem. It’s because of this line:

scheduler.load(“calendar_data.php?project_id=”. $_GET[‘project_id’]);

Should be

scheduler.load(“calendar_data.php?project_id=<?=$_GET['project_id']?>”)

duh