We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 12943
    • 97 Posts
    Hi Forum,

    luckily I learned long ago never to update MODx on a livesite.. so I'm testing 1.0.12 @home ;-)

    I used to connect to a 2nd database with db->connect(HOST,DBASE,USER,PASSWORD,PERSISTENT).
    Sometimes I have to do a db->disconnect() before this and sometimes a db->connect() afterwards, to get me away from (or back to) the modx database. AFAIK that worked from 0.9.x upto 1.0.9

    With this 1.0.12 update I keep getting "cannot select database" when trying to connect to this 2nd database. The database does exist and the login is right. I know this because I tried it with mysql_connect and mysql_select_db. AFAIK one can't do these mysql statements first to connect and then switch to existing db_select() methods, right?

    So.. am I missing something? What changed? Anyone have a clue or suggestion?

    TIA,
    IngMA
    Amsterdam

    This question has been answered by IngMA. See the first response.

      Accelerate your Windows system with 9.8 m/s2.
    • discuss.answer
      • 12943
      • 97 Posts
      Okay, I found it.
      It might be just me or due to my way of working with MODx, but the problem was the connect() method of the DBAPI class. Either I got cannot_select_database or it seemed to go into an endless loop until memory exhaustes.
      I changed the connect() method to one out of an older MODx version and now I'm fine. I couldn't put my finger on it what the exact differences are between the two methods :-/

      Well, hope this helps some people who are running into the same issue and end up here.
        Accelerate your Windows system with 9.8 m/s2.
      • Think it could be this issue: https://github.com/modxcms/evolution/issues/223