insert event with user id

Hi guy, i manage to filter my event according to my current user id but when i tried to insert new event, the event didn’t include my current user id. It becomes zero (default value).

$scheduler = new schedulerConnector($res); $scheduler->render_sql("select * from events where id = '$id'","event_id","start_date,end_date,text");

Hope u guys can help me.
thanks in advance

You can use beforeProcessing event docs.dhtmlx.com/connector__php__ … event.html

[code]function myUpdate($action){
$action->set_value(“id”)==$id;
}

$scheduler = new schedulerConnector($res);
$conn->event->attach(“beforeProcessing”,“myUpdate”);
$scheduler->render_sql(“select * from events where id = ‘$id’”,“event_id”,“start_date,end_date,text,id”);[/code]

Above code will set “id” parameter to some fixed value and will use it for all update|insert operations

I already use your code, but i’m getting a this error

<?php
	include ('session.php');
	include ('/config.php');
	include ('/codebase1/scheduler_connector.php');

    $res=mysql_connect($mysql_server,$mysql_user,$mysql_pass); 
    mysql_select_db($mysql_db); 
	$id = $userid;
	
	function myUpdate($action){
        $action->set_value("id")==$id;
}

$scheduler = new schedulerConnector($res);
$conn->event->attach("beforeProcessing","myUpdate");
$scheduler->render_sql("select * from events where id = '$id'","event_id","start_date,end_date,text,id");

?>

Hope your can help me. Thank in advance

Sorry, my snippet wasn’t fully correct. Please try to change it as follows

$scheduler = new schedulerConnector($res);
$scheduler->event->attach("beforeProcessing","myUpdate");
$scheduler->render_sql("select * from events where id = '$id'","event_id","start_date,end_date,text,id");

Hi, if I remove function myUpdate(), the page will not update my table.

This is my current code :

[code]<?php
include (‘session.php’);
include (‘/config.php’);
include (‘/codebase1/scheduler_connector.php’);

$res=mysql_connect($mysql_server,$mysql_user,$mysql_pass); 
mysql_select_db($mysql_db); 
$id = $userid;


$scheduler = new schedulerConnector($res);
$scheduler->event->attach("beforeProcessing","myUpdate");
$scheduler->render_sql("select * from events where id = '$id'","event_id","start_date,end_date,text,id");

?>
[/code]

And this is my event table


Thanks in advance sir.

Try to use the code like next.
It contains the myUpdate function and patch in the connector’s initialization from my previous response.

[code]<?php
include (‘session.php’);
include (’/config.php’);
include (’/codebase1/scheduler_connector.php’);

$res=mysql_connect($mysql_server,$mysql_user,$mysql_pass); 
mysql_select_db($mysql_db); 

$id = $userid;

function myUpdate($action){
$action->set_value(“id”)==$id;
}

$scheduler = new schedulerConnector($res);
$scheduler->event->attach(“beforeProcessing”,“myUpdate”);
$scheduler->render_sql(“select * from events where id = ‘$id’”,“events_id”,“start_date,end_date,text”);

?>[/code]