Questions on Database Connection

Steps 7 and 8 in the How to Start documentation is not real clear to me.

(1) Do I need to define a path to the data/connector.php (scheduler.load(“data/connector.php”):wink: or is it found automatically via the “…/scheduler/dhtmlxscheduler.js” ?

(2) what do I name my server-side php script and where on the server do I save it (Step 8. Server-side script)?

(3) re: $conn->render_table("events","id","start_date,end_date,text"); can I replace “events” with the custom name for my MySQL Table? Can I replace “id” with the custom column name I used in creating my table?

(4) The dhtmlxScheduler service is embedded in a script that is utilizing mysqli and not mysql. Should I change the connection settings to mysqli or will it work as is?

(5) I am getting a javascript alert popup window on page load that is blank/empty except for “myurl.com says:”

Hello,

When you call scheduler load with this argument:
scheduler.load(“data/connector.php”);

  • client side will send ajax GET to the given url (“data/connector.php”) and will expect xhr response to contain xml(or json depending on other arguments) dataset which can be loaded into scheduler docs.dhtmlx.com/scheduler/data_formats.html . So what you provide is an url from which scheduler will try to retrieve the data, client-side won’t figure the url unless you specify it.

Url in step (7) suggest that you have following structure

index.html - page with scheduler
data/connector.php - php file descibed in step (8)

you can name php file differently and/or put it somewhere else, the important things are to make sure you specify an url to it on a client side (scheduler.load argument) and that you specify a correct relative path to connectors library for require_once import in php file

Sure, render_table expects following arguments

$conn->render_table("table name","primary key column, must be auto increment","columns, comma separated");

when you specify columns, columns storing start/end and text description always must go first - regardles on actual column names, they will be loaded to the client as start_date, end_date and text respectively, after them you can specify any amount of other columns, all of them will be available on the client. You can also initialize connector with an sql query, e.g.

$conn->render_sql("SELECT id,start_date,end_date,text FROM events","id","start_date,end_date,text");

docs.dhtmlx.com/connector__php_ … #rendersql

(4) The dhtmlxScheduler service is embedded in a script that is utilizing mysqli and not mysql. Should I change the connection settings to mysqli or will it work as is?

dhtmlx connector have adapters for different database engines, please check these snippets:
docs.dhtmlx.com/connector__php_ … ample.html
You can switch your connection to mysqli

(5) I am getting a javascript alert popup window on page load that is blank/empty except for "myurl.com says:"

js alert probably means an invalid response from a backend - it can be either incorrect url provided to scheduler.load or server-side error in data.php - you can check it in network tab of browser dev tools

@Aliaksandr :

(1) is scheduler.load("data/connector.php"); my server-side script for extracting the data form the database or is it the same identical script as dhtmlxSchedule’s codebase/connector/data_connector.php?

(2) are the database connection scripts provided with the Scheduler download or do I need to download and install your dhtmlxConnector plugin as well?

Hi,

dhtmlxScheduler doesn’t know what code is running on a backend, so you can have any scripts there. The only requirement for the backend is to provide data in a correct format
docs.dhtmlx.com/scheduler/data_formats.html
If you’re going to use your own code instead of dhtmlx connectors it may be more convenient to switch to json format rather than xml,
clien:
scheduler.load(“url”, “json”);
http response:
docs.dhtmlx.com/scheduler/data_ … .html#json
Also please note that when you’ll be loading data from a backend, you’ll need to set scheduler.config.xml_date to match format of date-time values that comes from the backend, config so client-side could parse them
e.g. these samples
docs.dhtmlx.com/scheduler/sampl … tions.html
data, xml:
docs.dhtmlx.com/scheduler/sampl … /types.php
or
docs.dhtmlx.com/scheduler/sampl … _json.html
data, json:
screencast.com/t/jiGLoUhsG2

PHP connectors are included in scheduler package, you can find them in package/codebase/connector folder. There are also samples of usage in samples folder, like types.php/types_json.php that i referenced above. If you need connectors for java or ASP.NET - they should be downloaded separately dhtmlx.com/docs/products/dhtmlxConnector/