Not saving to database anymore

I’m not exactly certain when it started doing this, but my calendar does not save to the database anymore. I think it might have something to do with the POST because every item in there is prepended with a long number (please see attachment). Has anyone else experienced something like this before? Thank you for any input.


That is correct data request. Long number is the item’s id.
Check that you have autoincrement id field in DB.
If you are using custom code on server side, that expect to receive field without id added to all fields, you can add the next line after dp.init

dp.setTransactionMode("POST", false);

The id field in DB table is auto incremented.

I’m not using any custom code server side; the last thing I remember changing was turning recurring on in config.lightbox.sections:

{ name: ‘recurring’, height: 115, type: ‘recurring’, map_to: ‘rec_type’, button: ‘recurring’ }

It’s not reading from the database either.

I tried to recreate the simple sample from the Guides and that wont even load inline data. I must be doing something wrong? Could it be php related with my host?

Simple example with inline data (not working) - graphixadvocate.com/calendar

Hi,
in your example the format of dates in JSON does not mathes the format declared in scheduler.config.xml_date:

start_date:"04/11/2013 14:00"
[/code]vs[code]
scheduler.config.xml_date="%Y-%m-%d %H:%i";

So the events durations are parsed incorrectly. Additionally, it seems that you pass a ‘events’ string instead of the events variable to the scheduler.parse method[code]var events = …;

scheduler.parse(“events”, “json”);[/code]
docs.dhtmlx.com/scheduler/api__s … parse.html
docs.dhtmlx.com/scheduler/api__s … onfig.html

Okay that makes sense. I will update my code and see if it works, but to be fair I coped all of that code from the guide so obviously it’s wrong as well - docs.dhtmlx.com/scheduler/how_to_start.html

Ok I got the simple example working again on my server, but still can’t get the server data one to work. Can someone please take a look? Thanks!

graphixadvocate.com/house/calendar.php

Can you share a serve side code ? Currently it returns an empty dataset. You can check it by opening the next url in the browser
view-source:http://graphixadvocate.com/house/connector/connector.php

Also, you can try to enable logging for the connector and check is it generates the valid sql query for events retrieving.

docs.dhtmlx.com/connector__php__ … #enablelog

I tried to turn on the logging, but got this error:

<?xml version='1.0' encoding='utf-8' ?>

Warning: error_log(graphixadvocate.com/house/log.txt) [function.error-log]: failed to open stream: HTTP wrapper does not support writeable connections<br />
HTTP wrapper does not support writeable connections in /home3/felix822/public_html/house/connector/tools.php on line 205

You can see it here - graphixadvocate.com/house/calendar.php

I tried to recreate it, but still get nothing returned and/or saved to DB.

graphixadvocate.com/calendar

What part of server-side code should I post here? Thanks for the help.

The valid log command will be the next

error_log("./log.txt") 

without http url, just local file name.

Ah thank you that worked. I see what I’m doing wrong now. I switched my DB connection type from mysql_connect to mysqli and the internal functions did not like that. I switched it back to mysql_connect and it’s working again. Here are the errors from the log:

SELECT id,start_date,end_date,text FROM events2

mysql_query() expects parameter 2 to be resource, object given at /home3/felix822/public_html/calendar/codebase/connector/db_common.php line 1090

mysql_fetch_assoc() expects parameter 1 to be resource, null given at /home3/felix822/public_html/calendar/codebase/connector/db_common.php line 1100

Can we not use mysqli as the connection type since mysql_connect will soon be deprecated?

Never mind, sorry I should have read the documentation better :slight_smile: I found the answer to my question here - docs.dhtmlx.com/connector__php__ … ample.html

Thanks again for all your help!