Query isn't rendering properly in Scheduler.

I have used dhtmlScheduler in my PHPyii application and it renders the scheduler correctly but when i use render_sql for getting events for particular user it doesn’t show the events of that user instead it shows all user. I’ve used events_shared as well but it doesn’t showing me any output.
so can any one guide me what i can do to serve my purpose.


Please provide relevant server-side code.
In general enable log file. Open your “events.php” page in the browser.

  • check if correct events were returned in xml
  • check log file

Kind regards,

Thaks, for your reply.

I’ve enabled the log file and server side code is also there. but it is not showing me output what i want instead it showing me all database events.

I’m rendering the scheduler with sql in my Event_controller like this.
$scheduler->render_sql(“select * from events where user_id=10”,"event_id ", “start_date, end_date,event_name”);

but it is not working. whatever i write in the first argument which is query it ignores and show the all events.

  1. when i try to see the evnets.php in my browser it shows the error
    : Cannot redeclare class SchedulerDataItem in dhtmlx\connector\scheduler_connector.php on line 31

  2. can you explain me function of this line
    scheduler.load("./scheduler_data"); and from where this ./scheduler_data is coming.

Thanks for your time and consideration

If you are providing model to the connector, it will use it to fetch data instead of the provided SQL. To work with sql you can init normal mySQL connector and provide DB connection instead of the model object

docs.dhtmlx.com/doku.php?id=dhtm … ide_sample

  1. can you explain me function of this line
    scheduler.load("./scheduler_data"); and from where this ./scheduler_data is coming.

This redirect call to the {current_controller}/scheduler_data, which triggers scheduler_data method or related controller class, which will connect to DB and reply with data.

thanx for you reply got it what scheduler_data does, and why it is rendering whole table’s event, but still i m confused what exactly i should do to get event user wise.

in sheduler_data method of controller i have tried this according to new understanding by your guidance but still it is not working.

$scheduler = new SchedulerConnector(Events::model()->findByAttributes(array(‘user_id’=>10)); “phpYii”);

user_id is field of my Events table and suppose i need to get events of user id 10. but it s not working , again it is showing me the same all users output.

As SchedulerConnector class takes the result set as its first argument and i am giving result set of user 10’s event it should work logically i reckon. but it is not… so what to do.

thanx a lot for your time and consideration