Cannot insert extra fields to a DB table in dhtmlxscheduler

I am new with dhtmlxscheduler. I have created some demo schedulers. As everyone knows, we can make custom lightbox and send data accordingly, however, what I really want to know is how to send the value of a session variable to database from php as it has nothing to do with the lightbox. Well, I know it sounds messy. Below is my scheduler.html:

[code]

How to start html, body{ margin:0px; padding:0px; height:100%; overflow:hidden; }
 
 
 
[/code]

And this is my types.php:

[code]<?php
require_once(’…/…/common/connector/scheduler_connector.php’);
include(’…/…/common/config.php’);

$doctor_id=1;

$scheduler = new schedulerConnector($res, $dbtype);

$scheduler->render_table(“tevents”, “event_id”,“start_date,end_date,event_name,type”,“extra”);

?>[/code]

What I actually want to do is to insert the value of $doctor_id to the “extra” column of “tevents” table. What am I supposed to do ?

Thanks in advance !!!

You can use beforeUpdate ( or beforeProcessing ) server side event

Check docs.dhtmlx.com/connector__php__ … event.html

//sets new value for name and proceeds with default update. 
function myUpdate($action){
        $conn->add_field("extra",$_SESSION["extra"]);
}
$conn->event->attach("beforeUpdate","myUpdate");

Thanks a lot @Stanislav. You were right on point. Brother, will beforeUpdate work for all of Insert, Update or Delete operation ? And again, why not call myUpdate() with DataAction object “$action” ? Why do we only use $action while declaring ? What about calling them ?

beforeUpdate will work only for the update operation. You can use beforeInsert, beforeDelete for other actions. Or, you can use beforeProcessing to attach handler for all operations.

thanks a lot, brother… <3