Home > Software Development > SugarCRM and multiple databases

SugarCRM and multiple databases

When I’ve tried to develop my own module to integrate SugarCRM and RT2 I was surprised SugarCRM dosn’t suport using more than one database at one time! I’m a new in PHP. That’s why I spent a time to find why SugarCRM didn’t work at all! Probably, it is not good solution to connect to the database directly instead of using some webservice. But RT2 doesn’t provide any webservices (I’m going to create some webservice for RT2). The magical patch is here :)

— /home/misha/tmp/PearDatabase.php 2005-08-17 17:40:36.000000000 +0300
+++ /var/www/sugarcrm/include/database/PearDatabase.php 2005-07-01 18:01:00.000000000 +0300
@@ -184,7 +184,7 @@
$this->checkConnection();
$this->query_time = microtime();
if($this->dbType == “mysql”){
- $result =& mysql_query($SQL);
+ $result =& mysql_query($sql, $this->database);
$this->lastmysqlrow = -1;
}
else if ($this->dbType == “oci8″) {

Categories: Software Development Tags:
  1. August 17th, 2005 at 19:31 | #1

    The fact that PHP would use last opened mysql connection, unless you explicitly specify one is pretty stupid IMO.

  2. August 18th, 2005 at 09:46 | #2

    “Pretty stupid” specify connection handler directly or use last one?

  3. August 18th, 2005 at 14:45 | #3

    Just as I said – the fact that it uses last one. I agree, that it makes life easier in some cases, but if you have more than one opened connection at a time, it could be too easy to make a mistake.

  4. August 19th, 2005 at 11:16 | #4

    How about case if you need to copy some data from one database to another, for example?

  1. No trackbacks yet.

Get Adobe Flash playerPlugin by wpburn.com wordpress themes