Re: DB_DataObject and cross database links again
| From: | Dan Rossi | Date: | Wed, 06 Jul 2005 07:38:13 +0000 |
| Subject: | Re: DB_DataObject and cross database links again | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-19876@lists.php.net to get a copy of this message | ||
My bad we talked about this before, but I found out all I need to do is create a dsn to the second database in the options :\ No needs for database.table etc .
On 06/07/2005, at 5:29 PM, Dan Rossi wrote:
Hi there I am trying to update a table in another database. I have the dataobject setup with the other database. I am doing a get ok as in no errors its selecting the record in the database , but when I goto update it its trying tyo find the table in the current database. Doing this in the update query in the DataObject stopped this {$this->_database}.{$table} I tried to run a query to use the second database like so $users = DB_DataObject::factory('users'); $users->query("USE faults"); $users->get($_GET['ID']); //$users->userID = $_GET['ID']; $users->setFrom($_POST); if ($this->_post['password']) { $users->fromValue('password',$this->_password); } $users->update(); Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource (/Volumes/DATA/www/classes/PEAR/MDB2/Driver/mysql.php at line 924) (/Volumes/DATA/www/classes/PEAR/MDB2/Driver/mysql.php at line 924) (/Volumes/DATA/www/classes/PEAR/DB/DataObject.php at line 2293) (/Volumes/DATA/www/classes/PEAR/DB/DataObject.php at line 1520) (/Volumes/DATA/www/classes/Auth/Register.php at line 473) (/Volumes/DATA/www/pres/classes/Users/Profile.php at line 66) (/Volumes/DATA/www/classes/SBS/Page.php at line 49) (/Volumes/DATA/www/classes/SBS/Page.php at line 49)