а

How to insert extra data to database through scheduler connection in background


#1

Hi everybody, I am in DHX

I need to insert specific value to specific column in database,
I want to make program make it in background without use lightbox sections

this (php) code for database connection:

     $category=15;
     $res = new mysqli(DB_SERVER, DB_USER, DB_PASSWORD, DB_NAME);    
    $scheduler->render_sql("SELECT * FROM takvim_events where category like '" . $category. "' ", "event_id", 
   "start_date,end_date,event_name,details");

I just want to insert $category’s value to category column in database

any help please!

Thanks …


#2

Hi @Hasan_Naser,

If you have dataProcessor initialized, any change made by the user or programmatically will be automatically saved in the data source.
Just update the value for the required event property:

var event = scheduler.getEvent(1);
event.customProperty = "value";

then call addEvent method for this event to send update request to the server.

scheduler.addEvent(event)

Details in the documentation:
https://docs.dhtmlx.com/scheduler/server_integration.html#triggeringdatasavingfromscript