Forum Moderators: coopster

Message Too Old, No Replies

Switching from one database to another?

PHP is stuck using previously declared database.

         

JAB Creations

2:49 am on Feb 1, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm getting an error message about a table not existing in the previous database however this is already after I have made a connection to a different database. Do I have to unset the variable of the previous database connection before attempting to connect to the second database? All the variables (database name, user names, password and server (localhost)) are correct. For clarification going through every single database query and selecting which connection isn't an option for me.

- John

Matthew1980

11:29 am on Feb 1, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi there JAB_Creations,

I suppose that it would be an idea to null/unset that reference so that php doesn't assume anything. but I would have thought that just using mysql_select_db() would have done the job. I'm curious to see how this pans out, and what - if anything - is the cause...

How are you managing the switch at the moment?

Cheers,
MRb

JAB Creations

7:10 am on Feb 2, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks Matthew, I got the problem I encountered resolved for the most part and I think that's what I need to resolve the rest of the issues with. :)

- John