We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 43177
    • 11 Posts
    Beside my MODX Revo 2.2.14-pl (traditional) installation is a phpBB-Forum installed. Now I need some information from the phpbb database within modx.
    What I have is

    class dbInfo
    {
      public $strDbLocation = 'mysql:dbname=mydatabase;host=127.0.0.1';
      public $strDbUser = 'username';
      public $strDbPassword = 'passwd';
    }
    
    try
    {
      $dbInfo = new dbInfo();
      $objDb = new PDO($dbInfo->strDbLocation, $dbInfo->strDbUser, $dbInfo->strDbPassword);
    }
    catch (PDOException $e)
    {
      echo $e->getMessage();
    }
    
    [...]


    Works great, but I would like to have the class dbInfo within a seperat Snippet from what I can call the database, username and password.
    I think it's not a good idea to have the logininformation spread all over my snippets.
      • 30585
      • 833 Posts
      I believe you need to import your phpBB tables into the MODX database and generate XPDO classes as well as the database schema. More on this here: http://bobsguides.com/custom-db-tables.html.

      You can use CMPGenerator or MIGXdb to automate the process.
        A MODx Fanatic
        • 43177
        • 11 Posts
        Looks like your link is broken.

        Sad thing is, there is no possibility to import my phpBB to the MODX database :-(
          • 30585
          • 833 Posts
          Sorry, this should have been the link: http://bobsguides.com/custom-db-tables.html

          Too bad you can't import your tables. It would have made things much easier. There's probably a way around this. Maybe someone else has an idea.
            A MODx Fanatic