Jump to content

drtyrell

New Members
  • Posts

    3
  • Joined

  • Last visited

    Never

Everything posted by drtyrell

  1. Alright you geniuses. Here's the solution found on stackoverlfow dot com: "The next parameter to mysql_connect is $new_link, can you try sending in a true there and see if it helps? $this->connection = mysql_connect($host, $username, $password, true);" With TRUE one gets unique connection objects. If you don't know, just say you don't know.
  2. Sorry, that was a typo in trying to put together psuedo code for the forum. They are going into unique vars.
  3. Okay, real simple issue, hopefully someone has a simple solution. I have a single web page that needs to connect to TWO different databases. I've written everything in OO, and I'm getting a crazy situation where vars seem to be bleeding into each other. The problem goes like follows: I declare two SEPARATE database instances like so: require_once '/blah/classes/db/class.DBCMS.php'; require_once '/blah/classes/db/class.DBC.php'; $db1 = new DBC(); $db2 = new DBCMS(); I then pass in the $db(n) variables to a separate class to be used to process data like so: $publisher = new htmlCreator1($db1); $publisher = new htmlCreator2($db2); My problem is thus: INSIDE the respective different classes, my references to the $db vars seem to be colliding between instances. So $this->db->connection from db2 is referencing db1. The objects are defined like so: class htmlCreator1 { var $db; function __construct($db) { $this->db = $db; } } Shouldn't the respective $this->db's maintain their own namespace without extra work? I'm getting errors saying that tables in db2 aren't in db1 because of this collision as per the internal db instance vars. I have experimented with renaming all respective vars to unique names and still get the error. I'm crazy aren't I? Any help would be greatly appreciated. Thx, Dr.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.