
Ok got a little closer - looks like SQL is running on an odd port..
tsql now connects but Moodle doesnt...

Ok think I'm getting closer to the issue..
1) SQL Server installed on a non standard port!!
2) FreeTDS now connects and I can see the DBs when using the tsql command
but....
In Moodle I enter the "enrol_dbhost" asWhich, when I echo it in the view.php returnsCode:<serverIP>\<instance>,<port>Heres the strange bit - If I escape the \ ini "enrol_dbhost" in Moodle, it returns withCode:<serverIP>\\<instance>,<port>It looks like PHP is sensing it needs to escape the \ but then escapes the escape character!! ( so \ becomes \\ , \\ becomes \\\\ and so on...)Code:<serverIP>\\\\<instance>,<port>
Any thoughts here?
Last edited by Gatt; 12th January 2009 at 09:38 AM.

Got it working!!
1) In FreeTDS - Set TDS version to 9.0
2) In Moodle - Removed Instance
3) In Moodle - Removed Port
Also re-arranged the table array and labels for periods..

Changed the following line:
toPHP Code:$periods = array("" => 1,"1" => 2,"2"=> 3,"Reg"=> 4,"3"=> 5,"E4"=> 6,"L4"=> 7,"5"=> 8,"TWL"=> 9);
also changed the table headers for Periods from:PHP Code:$periods = array("Reg" => 1,"1" => 2,"2"=> 3,"3"=> 4,"4"=> 5,"5"=> 6,"6"=> 7,""=> 8,""=> 9);
toPHP Code:$periods_labels = array("","1","2","Reg","3","E4","L4","5","TWL");
and finally to remove empty rows i changedPHP Code:$periods_labels = array("Reg","1","2","3","4","5","6","","");
toPHP Code:for($i = 1; $i <= 9; ++$i)
Obviously, some of this will be different depending on how schools work their timetablesPHP Code:for($i = 1; $i <= 7; ++$i)

No - it never pulled it from MS SQL - Didnt know if I missed anything but it just never came down..

Ok just rechecked my dbo.dml_student_timetable view on the SQL server - there is no sign of any registration periods
they all say fri:1 , Mon:5 , thu:5 etc...
Hi Gatt,
try these settings
$periods = array("" => 1,"Reg" => 2,"1"=> 3,"2"=> 4,"3"=> 5,"4"=> 6,"5"=> 7,"6"=> 8,""=> 9);
$periods_labels = array("","Reg","1","2","3","4","5","6","");
for($i = 1; $i <= 8; ++$i)
This should display registration

Ta - though i dont think Reg has been dumped to the timetable views for Staff or pupils..
Did the following query on the mdl_student_timetable view..
This results in :Code:SELECT period_name, class_name, unique_pupil_no, staff_initials, room_name FROM mdl_student_timetable WHERE (unique_pupil_no = 'upn_of pupil_removed') ORDER BY period_name
(Only copied 1st two columns btw)Code:Fri:1 - 7y/Ma1 Fri:2 - 7y/Sc1 Fri:3 - 7y/Tt3 Fri:4 - 7y/Tt3 Fri:5 - 7y/Gg3 Fri:6 - 7y/Pe3 Mon:1 - 7y/It3 Mon:2 - 7y/En1 . . . .
No sign of any registrations...

Thanks - thats prorb what it is then...
There are currently 1 users browsing this thread. (0 members and 1 guests)