Results 1 to 7 of 7

Thread: OtherDatabase - anybody have experience with this?

  1. #1
    User
    Join Date
    09-08-09.
    Location
    Snellville, GA
    Posts
    194

    Default OtherDatabase - anybody have experience with this?

    I have a project that requires connecting to an external MySQL database to read scheduled events that are developed in a different database than Contao. I stumbled across the OtherDatabase extension in the repository and I think that might work for the connector and to use the event list module to display events from that database.

    Does anybody have any experience with this extension who could offer some advice? Documentation on this extension is limited.

    Ernest McDermon
    Snellville, GA

  2. #2
    New user
    Join Date
    06-29-09.
    Posts
    13

    Default Re: OtherDatabase - anybody have experience with this?

    Hey -
    On the same topic: where to paste the instructions (which file):
    In your code, create a new object:
    $myDb = OtherDatabase::getOtherInstance('example');
    where example is the key from the configuration array.

    Then you use this object just like you would $this->Database, f.e.
    $res = $myDb->prepare('SELECT * FROM myTable WHERE ?')->execute($someVar);
    while ($res->next())

    You may add additional keys to the config array and access them with OtherDatabase::getConfig(),
    possibly point to the example of an existing module, e.g. comments module

  3. #3
    New user andypillip's Avatar
    Join Date
    08-26-11.
    Location
    Munich, Germany
    Posts
    7

    Default Re: OtherDatabase - anybody have experience with this?

    First, I'd like to point out again that this is just a utility class for extension developers.

    If you install it, you can just use it in your code for your own extensions, it doesn't enable Contao to use external databases.

    So, if you like to read events from an external database, you'll need to program your own module, or extend Contao's event module.

    I wrote an extension catalog_otherDb, which extends the Catalog extension by the possibility to connect to an external database. If it helps I can provide you with the code.

  4. #4
    Experienced user
    Join Date
    06-10-09.
    Location
    Cape Town, South Africa
    Posts
    1,387

    Default Re: OtherDatabase - anybody have experience with this?

    You can also look at an older version of Typolight 2.7 and look for the modules/pun_bridge/ where the backend routines switch databases (between the typolight [contao] and punbb databases). This will not allow you to directly access/edit content remotely, as Contao only supports local access. However if you want to import or access other data you can use this method, like punBB does.

  5. #5
    New user
    Join Date
    06-29-09.
    Posts
    13

    Default Re: OtherDatabase - anybody have experience with this?

    Ok, I'm just trying to understand myself, where it code i can use this instructions. It could use an example, because the description for user is short.

  6. #6
    Experienced user
    Join Date
    06-10-09.
    Location
    Cape Town, South Africa
    Posts
    1,387

    Default Re: OtherDatabase - anybody have experience with this?

    just search google for "typolight 2.7.2 download"

  7. #7
    New user
    Join Date
    06-29-09.
    Posts
    13

    Default Re: OtherDatabase - anybody have experience with this?

    Ok thx

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •