Re: Bug in MDB ???

From: Date: Fri, 12 Mar 2004 13:01:47 +0000
Subject: Re: Bug in MDB ???
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-11254@lists.php.net to get a copy of this message
Anja Winkel wrote:
Hello, I´m Anja Winkel from Germany and I´m working with PEAR MDB. We currently work with an MSSQL Database and so I found out that mssql.php uses the standard database defined for the user who is logged in. The Method connect in mssql.php connects with server, username and password calling 'mssql_pconnect' or 'mssql_connect'(line 316) but doesn´t select the database specified in the connectionstring. I added the following lines, so that the database is correctly selected. if(!mssql_select_db($this->database_name)) {
        return($this->raiseError("Connect: Could not connect to selected database: $this->database_name"));
      } 
This should be unnecessary. MDB connects on demand as late as possible. This allows you to change the dsn without having to connect yourself again. Since MSSQL allows you to connect to the database server indepandent of a specific database MDB selects the database in the query method.
There is another thing I noticed working with MDB in cooperation with Postgresql:
   Using the QueryTool I had difficulties to update my Postgres database. It doesn´t like the updatequery which was created by Query.php using the         tablename as prefix,
I changed the line $values[] = "{$this->table}.$key=" . $this->_quote($aData); into
      $values[] = "$key=" . $this->_quote($aData);
      So it worked fine for me and postgres.
I dont know the querytool package well enough to comment on this, Lorenzo?
Perhaps the things I discovered help you.
Thanks for the feedback. As I mentioned in my other email pear-generel@lists.php.net is the appropriate list to ask user questions. regards, Lukas Smith smith@backendmedia.com _______________________________ BackendMedia www.backendmedia.com berlin@backendmedia.com Linn Zwoch Smith GbR Pariser Str. 44 D-10707 Berlin Tel +49 30 83 22 50 00 Fax +49 30 83 22 50 07

« previous php.pear.general (#11254) next »