How to put defaulte value to the table!

with this query i can get the event by user_id!

[code]
 $scheduler->render_sql("select * from tbl_events where user_id=".$this->session->userdata('user_id'), "event_id","start_date,end_date,event_name,details,user_id");

[/code]

So Is there anyway that i can set the value “user id” to the table field with down showing in the lightbox section??!

If you will have a select-box in the lightbox with map_to=“user_id” its value will be saved in user_id field.

To fill the select with options check
docs.dhtmlx.com/doku.php?id=dhtm … _scheduler

But I dont want to show this user_id in the Lightbox, I just want to set it automaticaly to the database!

I found the way! But it doesnt work! It show the event with the user_id but it doesnt set user_id value to the database!

[code] $userid=intval($this->session->userdata(‘user_id’));
$scheduler->enable_log(“log.txt”,true);

    function default_values($action){
        global $userid;
        $action->set_value("user_id",$userid);
    }
    $scheduler->event->attach("beforeProcessing","default_values");

    $scheduler->render_sql("select * from tbl_events where user_id=".$this->session->userdata('user_id'), "event_id","start_date,end_date,event_name,details,user_id");
 [/code]

Please provide content of log.txt for the problematic case.
Your code looks valid and must produce the expected result.

This code in my controller! So it’s doesnt have log file :slight_smile:

[code]
$userid=intval($this->session->userdata(‘user_id’));
$scheduler->enable_log(“log.txt”,true);

    function default_values($action){
        global $userid;
        $action->set_value("user_id",$userid);
    }
    $scheduler->event->attach("beforeProcessing","default_values");

    $scheduler->render_sql("select * from tbl_events where user_id=".$this->session->userdata('user_id'), "event_id","start_date,end_date,event_name,details,user_id");
[/code]

I found that it cant recieved $userid=intval($this->session->userdata(‘user_id’)); in the funtion default_values