Re: some MDB2 questions

From: Date: Thu, 10 Feb 2005 11:42:45 +0000
Subject: Re: some MDB2 questions
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-36116@lists.php.net to get a copy of this message
Andreas Korthaus wrote: Thx for your input.
After some time I found out that affectedRows() has been removed in CVS-Version after beta2 release of MDB2. But why (many people use it in PEAR::DB, ADOdb...)? So I have to use the return-value of query(), correct?
yes, this is inline with ext/pdo is doing it.
But how can I use something like numRows() as in DB_Result? Should I request the $rownum property?
no, same as in PEAR::DB $result->numRows(); keep in mind that numRows() is a senseless feature though. The cost of determening the number of rows is usually quite close to fetching the entire result set.
I'm not sure if the two methodes from PEAR::DB Wrapper (peardb.php) can work correct in CVS-Version: function affectedRows() {
    return $this->db_object->affectedRows();
}
This is no longer correct and needs to be updated.
ini_set('include_path', '../..'.PATH_SEPARATOR.ini_get('include_path')); really necessary?
No this is just for testing.
Does MDB2 support a syntax similar to ADOdb's
    while (!$rs->EOF) {
         print_r($rs->fields);           $rs->MoveNext();
    }
It will in the future provide a similar syntax in that you can bind result columns to variables. So all you have to do is move the internal pointer forward.
What is necessary to use the iterator from Iterator.php (foreach...)?
I still need to work out some issues when making internal fetch calls, but basically you can use: $mdb2->setOption('result_wrap_class', 'MDB2_Iterator'); havent tried this in a while though :-)
I tried to write an autoExecute() methode for ADOdb (http://phplens.com/lens/lensforum/msgs.php?id=11643). Now it is implemented there, but not my version, which I wrote on base of PEAR::DB/MDB/2, perhaps it is useful for you, I reduced the changes to buildManipSQL() from Extended.php:
Err, what exactly do you want changed? Is this a tweaked version of what is there, or does this provide more/less features?
Will there be a beta3 release in near future?
Basically I am just trying to get the fbsql and mssql drivers working. Even if I dont I will make a new release sometime this month. regards, Lukas

« previous php.pear.dev (#36116) next »