I’m a newbie on dhtmlx using it for the first time. I accomplished to have a basic scheduler, integrated with the PHP CodeIgniter framework getting data from the database (MySQL).
I activated the log on the connector ($conn->enable_log(“temp.log”) and I see these messages every time an event is inserted/updated/deleted:
UPDATE events SET `start_date`='2013-11-15 00:00',`end_date`='2013-11-15 00:05',`text`='Professional: Professional: Test' WHERE `id`='5'
Trying to get property of non-object at C:\xampp\htdocs\girh_gt\assets\dhtmlx\dhtmlxConnector\codebase\db_phpci.php line 56
Trying to get property of non-object at C:\xampp\htdocs\girh_gt\assets\dhtmlx\dhtmlxConnector\codebase\db_phpci.php line 57
Edit operation finished
0 => action:updated; sid:5; tid:5;
Done in 0.019180059432983s
The vent is modified OK, but I’d like to know why this error is happening. Any idea?
The code of the connector:
$this->load->database();
$conn = new SchedulerConnector($this->db, "PHPCI");
$conn->enable_log("temp.log");
$conn->configure("events","id","start_date,end_date,text", "professional");
$conn->render();
scheduler.setLoadMode(“year”); // Carrega dades dinàmicament, per no sobrecarregar. Es pot especificar month, week, …
scheduler.load(“<?php echo base_url(); ?>scheduler/scheduler/get_events”);
var dp = new dataProcessor(“<?php echo base_url(); ?>scheduler/scheduler/get_events”);
dp.action_param =“dhx_editor_status”;
dp.init(scheduler);[/code]
By live updates do you mean attaching the PHP connector?
Live update is a special mode, in which scheduler can update data automatically, when it was changed on the server side ( as far as I can see - this mode is not used )
Please send me a full code of client side page with scheduler initialization and server side connector’s code ( preferable as attachment ), I will try to reconstruct the same issue locally.
I’ve a different implementation using CI Model instead, and these errors have gone, but I have others when I init the scheduler:
Undefined variable: config at C:\xampp\htdocs\girh_gt\assets\dhtmlx\dhtmlxConnector\codebase\db_common.php line 500
Undefined variable: connection at C:\xampp\htdocs\girh_gt\assets\dhtmlx\dhtmlxConnector\codebase\db_common.php line 501
Which version of PHP you are using ?
I have tried to run the same code locally and it works correctly
Also, it seems that you are using not latest code in second case, as error line numbers are not valid. ( but I don’t thing that update will fix anything, as I can’t see how the above error messages can appear in old code as well )
Hello,
For the first problem for “Trying to get property of non-object at db_phpci.php line 56” or line 52 : it lacks some test on function “public function __construct($res)”.
You must control if $res is an object to have access to properties $res->num_rows and $res->current_row.
On db_phpci.php file, add in the PHPCIResultSet’s constructor this lines :
if(!is_object($res))
{
$this->count = ‘’;
$this->start = ‘’;
}
else
{
$this->count = $res->num_rows;
$this->start = $res->current_row;
}
Thus, you are no such problem. It would be a good idea to add this on the latest version.
Have a good day.
Casa