Scheduler doesn't work with PHP/MySQL

Has anyone managed to get Touch Scheduler to work with PHP/MySQL?
I can successfully load the data, but cannot add, change. I am using the Scheduler Connector. I made some changes to scheduler.js as follows:

	this.config.save = "data/mobile_load.php?user=3";

// if(!this.config.readonly&&this.config.save) … I removed this line
new dhx.DataProcessor({
master:this,
url:this.config.save
});

I suspect the problem has something to do with the date format, which is posting in full format instead of yyyy-mm-dd hh:mm as the database expects. I changed the code in Save as follows:
case “save”:
if(this.$$(“schEditForm”).validate()){
if(!this._settings.editEvent){
var data = this.$$(“schEditForm”).getValues();
data.id = dhx.uid();
data.start_date = convert_date(data.start_date); // added this
data.end_date = convert_date(data.end_date); // and this
this.add(data);
this.setCursor(data.id);
} else {
this.$$(“schEditForm”).save();
}
dhx.dp(this).save();
this.setDate();
this.$$(“schViews”).back();
}

My convert_date function is UGLY, so I won’t share it with you, but it works! When the date format is correct, the record is successfully added (although I have to refresh before it’s visible). I think I need the Touch equivalant of scheduler.config.xml_date. Does that exist?
When I try to change an event, it actually DELETES the record. Again, the date format in the POST is incorrect - I’m not sure how to fix this.
Any suggestions? Thanks :slight_smile:

Hi,

scheduler.config.xml_date that sets the date format for date in datasource is “%Y-%m-%d %H:%i” by default:
scheduler.config.xml_date = “%Y-%m-%d %H:%i”

Please check the sample with (PHP/MySQL):
dhtmlxScheduler_mobile_v35_120626/samples/01_basic/05_data_saving.html

Thanks Alexandra.
I went back to basics at the weekend and started building the app from scratch using the samples rather than the mobile scheduler and it’s working pretty well. I have run into some other problems, but they are not related to the connector so I’ll raise separate posts for them.
Thanks again for your help.
CK