Re: [PHP-PEAR] query() of common.php
[email protected] ((Stig Sæther Bakken)) 13 Mar 2001 23:13:37 +0100
| Newsgroups | php.pear |
|---|---|
| Message-ID | <[email protected]> |
[Burak DAYIOGLU <[email protected]>] > Hello all, > The below code is the most up to date implementation of query() in > common.php. The === seems to be a typo. Furthermore can anyone please > explain me the difference of query() and simplequery()? As far as I > understand with using simplequery()'s, I am only having a single result > set and when I use query(), I am having multiple result sets to operate > on. Is it the correct definition of the difference? No, the === is not a typo. It is the "exact equal" operator of PHP (which does not convert types when comparing). The simpleQuery() method returns a native result resource (just like for example mysql_query() does). The query() method returns a DB_result object, which is a wrapper object for the result resource (providing methods like fetchRow() and numCols()). > When will serious class documentation for PEAR start? I really want to > join in to help documenting classes as long as someone guides the staff. > > regards, > -bd > > function &query($query) { > $result = $this->simpleQuery($query); > if (DB::isError($result) || $result === DB_OK) { > return $result; > } else { > return new DB_result($this, $result); > } > } The documentation process has started. Check out the phpdoc/en/pear directory (I'm doing copy/paste from javadoc comments for now, we just need something that works until we have a satisfactory phpdoc solution). To document the class Foo_Bar, make a file called pear/foo-bar.xml. Start with a <reference id="class.foo-bar"> element, for member functions use <refentry id="function.foo-bar.method">. Feel free to email me directly if you need guidance. - Stig -- Stig Sæther Bakken <[email protected]> Fast Search & Transfer ASA, Trondheim, Norway