I’m having a problem using the render_complex_sql method in conjunction with DATE_FORMAT with MySQL. Running the query direct against the dates produces the correct output but when the same query is run through render_complex_sql() the output for start_date and end_date includes extra backslashes.
For example…
Here’s my query:
SELECT id, DATE_FORMAT(FROM_UNIXTIME(etimestamp), ‘%m/%d/%Y %H:%i’) AS start_date, DATE_FORMAT(FROM_UNIXTIME(endtimestamp), ‘%m/%d/%Y %H:%i’) AS end_date, title AS text FROM events WHERE calendar_id = 53815
And when switching to XML like this, the events show up correctly.
$conn = new SchedulerConnector($res);
However, I’m still interested in using JSON instead of XML. Here’s the JSON response that appears in a JavaScript alert when switching back to JSONScheduleConnector().
I’m not doing anything else besides running it through render_complex_sql. I did notice however, that removing the DATE_FORMAT functions from the SQL sends the dates back with dashes ( - ) instead of slashes. Is it possible the complex_sql method is somehow adding or incorrectly escaping slashes when DATE_FORMAT is used?
Extra slashes is an escaping, that must not hurt json parsing.
Are you using the similar code to load the data ( scheduler.load(url, “json”) ) or some custom ajax solution ?
Get a guaranteed answer from DHTMLX technical support team
under the most suitable support plan