Getting data from a non-joomla database

Hi there,

for the JOOMLA website of my tabeltennis club I am implementing dhtmlxsheduler using the connector to get data from a 2nd (non joomla) database.

I am developing at a non-live/production website, to test my code/component before putting it on the real website/internet.

I have 2 databases on the localhost mysql server: one for joomla (name it db_joomla) and one for tabeltennis related things (name it db_tt) like competition matches (which i would like to use in the scheduler to show up) and other kinds of events (like tournaments, activities, meetings).

I defined a view in the db_tt called vw_event_kalender. this view returnes, at this moment, some fields: ID, event_start, event_end, event_text.
Start and End are datetime field in a table in the db_tt. Their output format is: 2013-04-20 10:30:00 (so: 4-digit year, 2-digit month, 2 digit day, hours, minutes, seconds).
The text field will be a string concatenations of some fields from a table. (it might be going to contain carriage returns, but at the moment it only contains the number of a match. (integer).

In some way i dont get data to see in the visual calender… :frowning: and i dont know the reason, i dont get any response that things go wrong, the scheduler (visual calender) shows up, without displaying mistakes/errors, but also without events.

The documentation on here doesn’t make me things 100% clear, so I did change some code:

set the joomla to true, because the com_scheduler didn’t recognise it was running in joomla (turning on debug-mode did show a alert with WP_DIR or something, finding me out that a boolean was stil on false (in the constructor)).

code in the dhtmlxSchedulerConfigurator.php, near lines 957:
scheduler.init(“scheduler_here”,null,default_mode);
scheduler.loadXML("".$url.“connector/connector.php”);
var dp = new dataProcessor("".$loader_url.""+scheduler.uid());
dp.init(scheduler);";

the connector.php (is in directory: com_scheduler\codebase\connector):

<?php include("scheduler_connector.php"); //require_once( 'includes/db_connectie.php'); $user_name = "< a username >"; $password = "< usernames password >"; $database = "< db_tt >"; $server = "localhost"; $db_conn = mysql_connect($server, $user_name, $password); if (!$db_conn) { die('Not connected : ' . mysql_error()); } else { $db_selected = mysql_select_db($database, $db_conn); if (!$db_selected) { die('Can\'t use database table : ' . mysql_error()); } else { $scheduler = new SchedulerConnector($db_conn); //$scheduler->enable_log('com_scheduler.log', true); //LogMaster::log("any text here"); $scheduler->render_table('vw_event_kalender'); } } ?>

scheduler_connector.php (is the same directory as connector.php):
i commented the require_once to the db_tt connection file, database db_tt connection is in the connector.php.
the username, password, database i am using are correct, in the named database.

I can’t figure out why i dont get data loaded in the scheduler… the documentation on this website is not 100% clear for my, allthough mostly i can read through things.

Hope there is enough information to help me.

Some questions:
Is it possible to get data from a seperate/2nd database to be used in the scheduler?
What is the best directory to store the file connector.php in?
is scheduler.loadXML() the correct way? Or is scheduler.load() the correct way? And should the connector file be here?
Where do i make the big mistake that doenst load data for me?

Thanks for the help,
Carsten

After some more tweaks in the original code, i do get events in the back-end of joomla.

Still one more thing to do: show the events in the front end of joomla, on the (test/develope) website.

I dont get errors, but also no events to show up in the scheduler.
I guess some code, to receive or show the events (as result of the view in the non-joomla database) in the visible scheduler in the joomla website.

Joomla = 2.5.9
Browser = google chrome.