<![CDATA[ connect() cannot select database - My Forums]]> https://forums.modx.com/thread/?thread=90818 <![CDATA[connect() cannot select database]]> https://forums.modx.com/thread/90818/connect-cannot-select-database#dis-post-497522
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
]]>
IngMA May 09, 2014, 10:52 PM https://forums.modx.com/thread/90818/connect-cannot-select-database#dis-post-497522
<![CDATA[Re: connect() cannot select database]]> https://forums.modx.com/thread/90818/connect-cannot-select-database#dis-post-497684 https://github.com/modxcms/evolution/issues/223]]> Jako May 12, 2014, 01:30 AM https://forums.modx.com/thread/90818/connect-cannot-select-database#dis-post-497684 <![CDATA[Re: connect() cannot select database (Best Answer)]]> https://forums.modx.com/thread/90818/connect-cannot-select-database#dis-post-497599 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.
]]>
IngMA May 10, 2014, 07:36 PM https://forums.modx.com/thread/90818/connect-cannot-select-database#dis-post-497599