inserting session id into the database

hi,
thanks you for this great schedular…
I’ve been searching the forum for the last couple of days but couldn’t find a solution for my problem and any help would be appreciated.
while trying to display only their events to the logged in user (via session [id]) for some reason I can’t manage to enter the value for the session [id] to the database for filtering purposes. If I set manually the user_id via phpmyadmin I can see only the events which belong to the kogged in user but can’t enter new once. in the database field the value 0 is entered.
this is my code:

<?php
session_start();
        $user_id = $_SESSION['userid'];
	require_once('scheduler_connector.php');
	require_once('config.php');
        $connector = new SchedulerConnector($mysqli,"MySQLi");
        function default_values($action){
            global $user_id;
            $event_type = $action->get_value("userId");
            if ($event_type == "")
            $event_type = $user_id;

$action->set_value("userId",$user_id);
}
	$connector->event->attach("beforeProcessing","default_values");
	
	$connector->render_sql("select * from events where userId = ".$user_id,"id","start_date,end_date,text,details");

        $connector->render_table("events","id","userId,start_date,end_date,text,details");

?>

thanks, Dro

I managed to et i to work…
if anyone encounters the same problem here is the working code:

<?php
session_start();
        $user_id = $_SESSION['userid'];
	require_once('scheduler_connector.php');
	require_once('config.php');
        $connector = new SchedulerConnector($mysqli,"MySQLi");
        function default_values($action){
            global $user_id;
            $action->add_field("userId", $user_id);
            
}
	$connector->event->attach("beforeProcessing","default_values");
	
	$connector->render_sql("select * from events where userId = ".$user_id,"id","start_date,end_date,text,details");

        $connector->render_table("events","id","start_date,end_date,text,details");

?>

thanks for a great forum and a great product…