Jump to content

How to synchronise offline and online databases successfully?


keveen

Recommended Posts

Online server - PHP and MySQL5

Offline server - PHP and MySQL 4

 

As a non-expert I use phpMyAdmin to backup, import and export databases.

 

I can work offline and synchronise files and databse online no problem using Joomla and mambo. I only have problems with Claroline and Dokeos.

 

I installed the package online and then made a mirror image copy for my offline site. I adjusted the claro_main.conf.php database info and root site to Localhost instead of my Live Site. It all worked offline - a nice working copy of my online site on my own PC.

 

Then I imported a new SCORM package Offline, synchronised the files with my Online site and then Exported the database and Imported it into my Online site - and it does not work. When I go to the main site http://www.the-bizness.co.uk/claroline183/ it all works until I go to the course and hit Learning Path - http://www.the-bizness.co.uk/claroline183/claroline/learnPath/learningPathList.php- and these are the errors:

 

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/thebizn/public_html/claroline183/claroline/learnPath/learningPathList.php on line 547

 

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/thebizn/public_html/claroline183/claroline/learnPath/learningPathList.php on line 551

 

Line 547 = $LPNumber = mysql_num_rows($result);

 

Line 551 = while ( $list = mysql_fetch_array($result) ) // while ... learning path list

 

The code sequence is here:

 

// used to know if the down array (for order) has to be displayed
$LPNumber = mysql_num_rows($result);
$iterator = 1;

$is_blocked = false;
while ( $list = mysql_fetch_array($result) ) // while ... learning path list
{ 

 

have turned on error reporting and you can see here:

 

http://www.the-bizness.co.uk/claroline183/

 

And the Learning Path here:

 

http://www.the-bizness.co.uk/claroline183/claroline/learnPath/learningPathList.php

 

Very frustrating!

 

I did the same thing for my Localhost installation and there are no errors.

I had a moment of "inspiration" remembering that I read somewhere that the Unicode settings could cause some errors. I checked and one database collation is set for Swedish1 and the other one uft8. I made them both uft8. Some of the errors have gone but not the Learning Path ones.

I tested again by Importing a SCORM package while online and then synchronising the database with my PC/Offline version and as expected there are no errors (I have turned error reporting ON). But if I do the opposite I get the errors you see at the Learning Path.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.