A few years ago i was using Scheduler 2.5 and now upgraded to 5.0.
I tried to configure the Connection like before but got an error and no events. I really Need help and that someone explain me what i’m doing wrong.
// init Scheduler
scheduler.init('scheduler_here',new Date(),"week");
scheduler.load("../../../dhtmlx/Scheduler/php/events.php");
// events.php
include("../../../dhtmlx/Scheduler/codebase/scheduler_connector.php");
$db = mysqli_connect($hostname, $username, $password) or die ("ERROR: No Connection!");
mysqli_select_db($db, $database);
$scheduler = new SchedulerConnector($db,"MySQL");
$scheduler->render_table("termine","termin_id","start_date,end_date,text");
This is the error i get:
Fatal error: Uncaught Exception: DB class not found: MySQL in /kunden/531297_42329/webseiten/ev1/main/dhtmlx/Scheduler/codebase/base_connector.php:356 Stack trace: #0 /kunden/531297_42329/webseiten/ev1/main/dhtmlx/Scheduler/codebase/scheduler_connector.php(78): Connector->__construct(Object(mysqli), ‘MySQL’, ‘SchedulerDataIt…’, ‘SchedulerDataPr…’, ‘RenderStrategy’) #1 /kunden/531297_42329/webseiten/ev1/main/dhtmlx/Scheduler/php/events.php(18): SchedulerConnector->__construct(Object(mysqli), ‘MySQL’) #2 {main} thrown in /kunden/531297_42329/webseiten/ev1/main/dhtmlx/Scheduler/codebase/base_connector.php on line 356
Double-check the second parameter here, it must be “MYSQLi” with “i” at the end.
If you are using any other connectors ( options, etc. ) be sure that they are using the correct type as well.
session_start();
require_once("../../../dhtmlx/Connector/db_mysqli.php");
include("../../../dhtmlx/Scheduler/codebase/scheduler_connector.php");
$db = mysqli_connect($hostname, $username, $password) or die ("ERROR: No Connection!");
mysqli_select_db($db, $database);
$scheduler = new SchedulerConnector($db,"MySQLi");
$scheduler->render_table("termine","termin_id","start_date,end_date,text");
EDIT
I think first mistake is that i have to load scheduler_connector.php before db_mysqli.php:
Fatal error: Cannot declare class DBDataWrapper, because the name is already in use in /dhtmlx/Connector/db_common.php on line 1057
EDIT #2
I found the following topic where i understand a problem with db_mysql.php
https://github.com/DHTMLX/connector-php/pull/16
I did like in the topic above explained. I included db_common.php in db_mysql.php, db_mysql.php in db_mysqli.php and deleted db_common.php in db_mysqli.php. But now got a new error
Fatal error: Cannot declare class EventMaster, because the name is already in use in /dhtmlx/Scheduler/codebase/tools.php on line 9
include ('../../codebase/scheduler_connector.php');
include ('../../codebase/db_mysqli.php');
$res = mysqli_connect($mysql_server,$mysql_user,$mysql_pass, $mysql_db);
$scheduler = new SchedulerConnector($res, "MYSQLi");
$scheduler->render_table("events","event_id","start_date,end_date,event_name,details");
And it renders data correctly. If it still causes the issue on your side, can you share the exact version of php in your case.
OK … seems to be normal because i got a log-file where it says that there is an error because of Header modification. I deleted the echos and now it’s working
Thank you so much for your help
Best regards
Oliver
Get a guaranteed answer from DHTMLX technical support team
under the most suitable support plan