home *** CD-ROM | disk | FTP | other *** search
/ Enter 2004 June / ENTER.ISO / files / xampp-win32-1.4.5-installer.exe / xampp / skeleton.php < prev    next >
Encoding:
PHP Script  |  2004-03-24  |  25.2 KB  |  770 lines

  1. <?php
  2. // +----------------------------------------------------------------------+
  3. // | PHP Version 4                                                        |
  4. // +----------------------------------------------------------------------+
  5. // | Copyright (c) 1998-2004 Manuel Lemos, Tomas V.V.Cox,                 |
  6. // | Stig. S. Bakken, Lukas Smith                                         |
  7. // | All rights reserved.                                                 |
  8. // +----------------------------------------------------------------------+
  9. // | MDB is a merge of PEAR DB and Metabases that provides a unified DB   |
  10. // | API as well as database abstraction for PHP applications.            |
  11. // | This LICENSE is in the BSD license style.                            |
  12. // |                                                                      |
  13. // | Redistribution and use in source and binary forms, with or without   |
  14. // | modification, are permitted provided that the following conditions   |
  15. // | are met:                                                             |
  16. // |                                                                      |
  17. // | Redistributions of source code must retain the above copyright       |
  18. // | notice, this list of conditions and the following disclaimer.        |
  19. // |                                                                      |
  20. // | Redistributions in binary form must reproduce the above copyright    |
  21. // | notice, this list of conditions and the following disclaimer in the  |
  22. // | documentation and/or other materials provided with the distribution. |
  23. // |                                                                      |
  24. // | Neither the name of Manuel Lemos, Tomas V.V.Cox, Stig. S. Bakken,    |
  25. // | Lukas Smith nor the names of his contributors may be used to endorse |
  26. // | or promote products derived from this software without specific prior|
  27. // | written permission.                                                  |
  28. // |                                                                      |
  29. // | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS  |
  30. // | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT    |
  31. // | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS    |
  32. // | FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE      |
  33. // | REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,          |
  34. // | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, |
  35. // | BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS|
  36. // |  OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED  |
  37. // | AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT          |
  38. // | LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY|
  39. // | WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE          |
  40. // | POSSIBILITY OF SUCH DAMAGE.                                          |
  41. // +----------------------------------------------------------------------+
  42. // | Author: YOUR NAME <YOUR EMAIL>                                       |
  43. // +----------------------------------------------------------------------+
  44. //
  45. // $Id: skeleton.php,v 1.16.4.1 2004/01/08 13:43:05 lsmith Exp $
  46. //
  47.  
  48. // This is just a skeleton MDB driver.
  49. // There may be methods missing as this skeleton is based on the methods
  50. // implemented by the MySQL and PostGreSQL drivers in MDB.
  51. // Some methods may not have to be implemented in the driver, because the
  52. // implementation in common.php is compatible with the given RDBMS.
  53. // In each of the listed methods I have added comments that tell you where
  54. // to look for a "reference" implementation.
  55. // Some of these methods have been expanded or changed slightly in MDB.
  56. // Looking in the relevant MDB Wrapper should give you some pointers, some
  57. // other difference you will only discover by looking at one of the existing
  58. // MDB driver or the common implementation in common.php.
  59. // One thing that will definately have to be modified in all "reference"
  60. // implementations of Metabase methods is the error handling.
  61. // Anyways don't worry if you are having problems: Lukas Smith is here to help!
  62.  
  63. require_once('MDB/Common.php');
  64.  
  65. /**
  66.  * MDB XXX driver
  67.  *
  68.  * @package MDB
  69.  * @category Database
  70.  * @author  YOUR NAME <YOUR EMAIL>
  71.  */
  72. class MDB_xxx extends MDB_Common
  73. {
  74. // Most of the class variables are taken from the corresponding Metabase driver.
  75. // Few are taken from the corresponding PEAR DB driver.
  76. // Some are MDB specific.
  77.     var $connection = 0;
  78.     var $connected_host;
  79.     var $connected_user;
  80.     var $connected_password;
  81.     var $connected_port;
  82.     var $opened_persistent = '';
  83.  
  84.     var $escape_quotes = "\\";
  85.     var $decimal_factor = 1.0;
  86.  
  87.     var $highest_fetched_row = array();
  88.     var $columns = array();
  89.  
  90.     // }}}
  91.     // {{{ constructor
  92.  
  93.     /**
  94.     * Constructor
  95.     */
  96.     function MDB_xxx()
  97.     {
  98.         $this->MDB_common();
  99.         $this->phptype = 'xxx';
  100.         $this->dbsyntax = 'xxx';
  101.  
  102.         // most of the following codes needs to be taken from the corresponding Metabase driver setup() methods
  103.         
  104.         // the error code maps from corresponding PEAR DB driver constructor
  105.  
  106.         // also please remember to "register" all driver specific options here like so
  107.         // $this->options['option_name'] = 'non NULL default value';
  108.     }
  109.  
  110.     // }}}
  111.     // {{{ errorNative()
  112.  
  113.     /**
  114.      * Get the native error code of the last error (if any) that
  115.      * occured on the current connection.
  116.      *
  117.      * @access public
  118.      *
  119.      * @return int native XXX error code
  120.      */
  121.     function errorNative()
  122.     {
  123.         // take this method from the corresponding PEAR DB driver: errorNative()
  124.     }
  125.  
  126.     // }}}
  127.     // {{{ xxxRaiseError()
  128.  
  129.     /**
  130.      * This method is used to communicate an error and invoke error
  131.      * callbacks etc.  Basically a wrapper for MDB::raiseError
  132.      * that checks for native error msgs.
  133.      *
  134.      * @param integer $errno error code
  135.      * @return object a PEAR error object
  136.      * @access public
  137.      * @see PEAR_Error
  138.      */
  139.     function xxxRaiseError($errno = NULL)
  140.     {
  141.         // take this method from the corresponding PEAR DB driver: xxxRaiseError()
  142.     }
  143.  
  144.     // }}}
  145.     // {{{ autoCommit()
  146.  
  147.     /**
  148.      * Define whether database changes done on the database be automatically
  149.      * committed. This function may also implicitly start or end a transaction.
  150.      *
  151.      * @param boolean $auto_commit    flag that indicates whether the database
  152.      *                                changes should be committed right after
  153.      *                                executing every query statement. If this
  154.      *                                argument is 0 a transaction implicitly
  155.      *                                started. Otherwise, if a transaction is
  156.      *                                in progress it is ended by committing any
  157.      *                                database changes that were pending.
  158.      *
  159.      * @access public
  160.      *
  161.      * @return mixed MDB_OK on success, a MDB error on failure
  162.      */
  163.     function autoCommit($auto_commit)
  164.     {
  165.         // take this from the corresponding Metabase driver: AutoCommitTransactions()
  166.         // the MetabaseShutdownTransactions function is handled by the PEAR desctructor
  167.     }
  168.  
  169.     // }}}
  170.     // {{{ commit()
  171.  
  172.     /**
  173.      * Commit the database changes done during a transaction that is in
  174.      * progress. This function may only be called when auto-committing is
  175.      * disabled, otherwise it will fail. Therefore, a new transaction is
  176.      * implicitly started after committing the pending changes.
  177.      *
  178.      * @access public
  179.      *
  180.      * @return mixed MDB_OK on success, a MDB error on failure
  181.      */
  182.     function commit()
  183.     {
  184.         // take this from the corresponding Metabase driver: CommitTransaction()
  185.     }
  186.  
  187.     // }}}
  188.     // {{{ rollback()
  189.  
  190.     /**
  191.      * Cancel any database changes done during a transaction that is in
  192.      * progress. This function may only be called when auto-committing is
  193.      * disabled, otherwise it will fail. Therefore, a new transaction is
  194.      * implicitly started after canceling the pending changes.
  195.      *
  196.      * @access public
  197.      *
  198.      * @return mixed MDB_OK on success, a MDB error on failure
  199.      */
  200.     function rollback()
  201.     {
  202.         // take this from the corresponding Metabase driver: RollbackTransaction()
  203.     }
  204.  
  205.     // }}}
  206.     // {{{ connect()
  207.  
  208.     /**
  209.      * Connect to the database
  210.      *
  211.      * @return TRUE on success, MDB_Error on failure
  212.      **/
  213.     function connect()
  214.     {
  215.         // take this from the corresponding Metabase driver: Connect() and Setup()
  216.         if (PEAR::isError(PEAR::loadExtension($this->phptype))) {
  217.             return(PEAR::raiseError(NULL, MDB_ERROR_NOT_FOUND,
  218.                 NULL, NULL, 'extension '.$this->phptype.' is not compiled into PHP',
  219.                 'MDB_Error', TRUE));
  220.         }
  221.     }
  222.  
  223.     // }}}
  224.     // {{{ _close()
  225.     /**
  226.      * all the RDBMS specific things needed close a DB connection
  227.      *
  228.      * @access private
  229.      *
  230.      */
  231.     function _close()
  232.     {
  233.         // take this from the corresponding Metabase driver: Close()
  234.     }
  235.  
  236.     // }}}
  237.     // {{{ query()
  238.  
  239.     /**
  240.      * Send a query to the database and return any results
  241.      *
  242.      * @access public
  243.      *
  244.      * @param string  $query  the SQL query
  245.      * @param array   $types  array that contains the types of the columns in
  246.      *                        the result set
  247.      *
  248.      * @return mixed a result handle or MDB_OK on success, a MDB error on failure
  249.      */
  250.     function query($query, $types = NULL)
  251.     {
  252.         // take this from the corresponding Metabase driver: Query()
  253.     }
  254.  
  255.     // }}}
  256.     // {{{ subSelect()
  257.  
  258.     /**
  259.      * simple subselect emulation for Mysql
  260.      *
  261.      * @access public
  262.      *
  263.      * @param string $query the SQL query for the subselect that may only
  264.      *                      return a column
  265.      * @param string $quote determines if the data needs to be quoted before
  266.      *                      being returned
  267.      *
  268.      * @return string the query
  269.      */
  270.     function subSelect($query, $quote = FALSE)
  271.     {
  272.         // This is a new method that only needs to be added if the RDBMS does
  273.         // not support sub-selects. See the MySQL driver for an example
  274.     }
  275.  
  276.     // }}}
  277.     // {{{ replace()
  278.  
  279.     /**
  280.      * Execute a SQL REPLACE query. A REPLACE query is identical to a INSERT
  281.      * query, except that if there is already a row in the table with the same
  282.      * key field values, the REPLACE query just updates its values instead of
  283.      * inserting a new row.
  284.      *
  285.      * The REPLACE type of query does not make part of the SQL standards. Since
  286.      * practically only MySQL implements it natively, this type of query is
  287.      * emulated through this method for other DBMS using standard types of
  288.      * queries inside a transaction to assure the atomicity of the operation.
  289.      *
  290.      * @access public
  291.      *
  292.      * @param string $table name of the table on which the REPLACE query will
  293.      *  be executed.
  294.      * @param array $fields associative array that describes the fields and the
  295.      *  values that will be inserted or updated in the specified table. The
  296.      *  indexes of the array are the names of all the fields of the table. The
  297.      *  values of the array are also associative arrays that describe the
  298.      *  values and other properties of the table fields.
  299.      *
  300.      *  Here follows a list of field properties that need to be specified:
  301.      *
  302.      *    Value:
  303.      *          Value to be assigned to the specified field. This value may be
  304.      *          of specified in database independent type format as this
  305.      *          function can perform the necessary datatype conversions.
  306.      *
  307.      *    Default:
  308.      *          this property is required unless the Null property
  309.      *          is set to 1.
  310.      *
  311.      *    Type
  312.      *          Name of the type of the field. Currently, all types Metabase
  313.      *          are supported except for clob and blob.
  314.      *
  315.      *    Default: text
  316.      *
  317.      *    Null
  318.      *          Boolean property that indicates that the value for this field
  319.      *          should be set to NULL.
  320.      *
  321.      *          The default value for fields missing in INSERT queries may be
  322.      *          specified the definition of a table. Often, the default value
  323.      *          is already NULL, but since the REPLACE may be emulated using
  324.      *          an UPDATE query, make sure that all fields of the table are
  325.      *          listed in this function argument array.
  326.      *
  327.      *    Default: 0
  328.      *
  329.      *    Key
  330.      *          Boolean property that indicates that this field should be
  331.      *          handled as a primary key or at least as part of the compound
  332.      *          unique index of the table that will determine the row that will
  333.      *          updated if it exists or inserted a new row otherwise.
  334.      *
  335.      *          This function will fail if no key field is specified or if the
  336.      *          value of a key field is set to NULL because fields that are
  337.      *          part of unique index they may not be NULL.
  338.      *
  339.      *    Default: 0
  340.      *
  341.      * @return mixed MDB_OK on success, a MDB error on failure
  342.      */
  343.     function replace($table, $fields)
  344.     {
  345.         // take this from the corresponding Metabase driver: Replace()
  346.     }
  347.  
  348.     // }}}
  349.     // {{{ getColumnNames()
  350.  
  351.     /**
  352.      * Retrieve the names of columns returned by the DBMS in a query result.
  353.      *
  354.      * @param resource   $result    result identifier
  355.      * @return mixed                an associative array variable
  356.      *                              that will hold the names of columns. The
  357.      *                              indexes of the array are the column names
  358.      *                              mapped to lower case and the values are the
  359.      *                              respective numbers of the columns starting
  360.      *                              from 0. Some DBMS may not return any
  361.      *                              columns when the result set does not
  362.      *                              contain any rows.
  363.      *
  364.      *                              a MDB error on failure
  365.      * @access public
  366.      */
  367.     function getColumnNames($result)
  368.     {
  369.         // take this from the corresponding Metabase driver: GetColumnNames()
  370.     }
  371.  
  372.     // }}}
  373.     // {{{ numCols()
  374.  
  375.     /**
  376.      * Count the number of columns returned by the DBMS in a query result.
  377.      *
  378.      * @param resource    $result        result identifier
  379.      * @access public
  380.      * @return mixed integer value with the number of columns, a MDB error
  381.      *                       on failure
  382.      */
  383.     function numCols($result)
  384.     {
  385.         // take this from the corresponding Metabase driver: NumberOfColumns()
  386.     }
  387.  
  388.     // }}}
  389.     // {{{ endOfResult()
  390.  
  391.     /**
  392.     * check if the end of the result set has been reached
  393.     *
  394.     * @param resource    $result result identifier
  395.     * @return mixed TRUE or FALSE on sucess, a MDB error on failure
  396.     * @access public
  397.     */
  398.     function endOfResult($result)
  399.     {
  400.         // take this from the corresponding Metabase driver: EndOfResult()
  401.     }
  402.  
  403.     // }}}
  404.     // {{{ _retrieveLob()
  405.  
  406.     /**
  407.      * fetch a float value from a result set
  408.      *
  409.      * @param int $lob handle to a lob created by the createLob() function
  410.      * @return mixed MDB_OK on success, a MDB error on failure
  411.      * @access private
  412.      */
  413.     function _retrieveLob($lob)
  414.     {
  415.         // take this from the corresponding Metabase driver: RetrieveLOB()
  416.     }
  417.  
  418.     // }}}
  419.     // {{{ endOfResultLob()
  420.  
  421.     /**
  422.      * Determine whether it was reached the end of the large object and
  423.      * therefore there is no more data to be read for the its input stream.
  424.      *
  425.      * @param int    $lob handle to a lob created by the createLob() function
  426.      * @return mixed TRUE or FALSE on success, a MDB error on failure
  427.      * @access public
  428.      */
  429.     function endOfResultLob($lob)
  430.     {
  431.         // take this from the corresponding Metabase driver: EndOfResultLOB()
  432.     }
  433.  
  434.     // }}}
  435.     // {{{ _readResultLob()
  436.  
  437.     /**
  438.      * Read data from large object input stream.
  439.      *
  440.      * @param int $lob handle to a lob created by the createLob() function
  441.      * @param blob $data reference to a variable that will hold data to be
  442.      *      read from the large object input stream
  443.      * @param int $length integer value that indicates the largest ammount of
  444.      *      data to be read from the large object input stream.
  445.      * @return mixed length on success, a MDB error on failure
  446.      * @access private
  447.      */
  448.     function _readResultLob($lob, &$data, $length)
  449.     {
  450.         // take this from the corresponding Metabase driver: ReadResultLOB()
  451.     }
  452.  
  453.     // }}}
  454.     // {{{ _destroyResultLob()
  455.  
  456.     /**
  457.      * Free any resources allocated during the lifetime of the large object
  458.      * handler object.
  459.      *
  460.      * @param int $lob handle to a lob created by the createLob() function
  461.      * @access private
  462.      */
  463.     function _destroyResultLob($lob)
  464.     {
  465.         // take this from the corresponding Metabase driver: DestroyResultLOB()
  466.     }
  467.  
  468.     // }}}
  469.     // {{{ fetch()
  470.  
  471.     /**
  472.     * fetch value from a result set
  473.     *
  474.     * @param resource    $result result identifier
  475.     * @param int    $row    number of the row where the data can be found
  476.     * @param int    $field    field number where the data can be found
  477.     * @return mixed string on success, a MDB error on failure
  478.     * @access public
  479.     */
  480.     function fetch($result, $row, $field)
  481.     {
  482.         // take this from the corresponding Metabase driver: FetchResult()
  483.     }
  484.  
  485.     // }}}
  486.     // {{{ fetchClob()
  487.  
  488.     /**
  489.     * fetch a clob value from a result set
  490.     *
  491.     * @param resource    $result result identifier
  492.     * @param int    $row    number of the row where the data can be found
  493.     * @param int    $field    field number where the data can be found
  494.     * @return mixed content of the specified data cell, a MDB error on failure,
  495.     *               a MDB error on failure
  496.     * @access public
  497.     */
  498.     function fetchClob($result, $row, $field)
  499.     {
  500.         // take this from the corresponding Metabase driver: FetchCLOB()
  501.     }
  502.  
  503.     // }}}
  504.     // {{{ fetchBlob()
  505.  
  506.     /**
  507.     * fetch a blob value from a result set
  508.     *
  509.     * @param resource    $result result identifier
  510.     * @param int    $row    number of the row where the data can be found
  511.     * @param int    $field    field number where the data can be found
  512.     * @return mixed content of the specified data cell, a MDB error on failure
  513.     * @access public
  514.     */
  515.     function fetchBlob($result, $row, $field)
  516.     {
  517.         // take this from the corresponding Metabase driver: FetchBLOB()
  518.     }
  519.  
  520.     // }}}
  521.     // {{{ resultIsNull()
  522.  
  523.     /**
  524.      * Determine whether the value of a query result located in given row and
  525.      *   field is a NULL.
  526.      *
  527.      * @param resource    $result result identifier
  528.      * @param int    $row    number of the row where the data can be found
  529.      * @param int    $field    field number where the data can be found
  530.      * @return mixed TRUE or FALSE on success, a MDB error on failure
  531.      * @access public
  532.      */
  533.     function resultIsNull($result, $row, $field)
  534.     {
  535.         // take this from the corresponding Metabase driver: ResultIsNull()
  536.     }
  537.  
  538.     // }}}
  539.     // {{{ convertResult()
  540.  
  541.     /**
  542.     * convert a value to a RDBMS indepdenant MDB type
  543.     *
  544.     * @param mixed  $value   value to be converted
  545.     * @param int    $type    constant that specifies which type to convert to
  546.     * @return mixed converted value
  547.     * @access public
  548.     */
  549.     function convertResult($value, $type)
  550.     {
  551.         // take this from the corresponding Metabase driver: ConvertResult()
  552.     }
  553.  
  554.     // }}}
  555.     // {{{ numRows()
  556.  
  557.     /**
  558.     * returns the number of rows in a result object
  559.     *
  560.      * @param ressource $result a valid result ressouce pointer
  561.     * @return mixed MDB_Error or the number of rows
  562.     * @access public
  563.     */
  564.     function numRows($result)
  565.     {
  566.         // take this from the corresponding Metabase driver: NumberOfRows()
  567.     }
  568.  
  569.     // }}}
  570.     // {{{ freeResult()
  571.  
  572.     /**
  573.      * Free the internal resources associated with $result.
  574.      *
  575.      * @param $result result identifier
  576.      * @return bool TRUE on success, FALSE if $result is invalid
  577.      * @access public
  578.      */
  579.     function freeResult($result)
  580.     {
  581.         // take this from the corresponding Metabase driver: FreeResult()
  582.     }
  583.  
  584.     // }}}
  585.     // {{{ get*Declaration()
  586.  
  587.     // take phpdoc comments from MDB common.php: get*Declaration()
  588.  
  589.     function get*Declaration($name, $field)
  590.     {
  591.         // take this from the corresponding Metabase driver: Get*FieldValue()
  592.     }
  593.  
  594.     // }}}
  595.     // {{{ get*Value()
  596.  
  597.     /**
  598.      * Convert a text value into a DBMS specific format that is suitable to
  599.      * compose query statements.
  600.      *
  601.      * @param resource  $prepared_query query handle from prepare()
  602.      * @param           $parameter
  603.      * @param           $clob
  604.      * @return string  text string that represents the given argument value in
  605.      *                 a DBMS specific format.
  606.      * @access public
  607.      */
  608.     function get*Value($prepared_query, $parameter, $clob)
  609.     {
  610.         // take this from the corresponding Metabase driver: Get*FieldValue()
  611.     }
  612.  
  613.     // }}}
  614.     // {{{ getClobValue()
  615.  
  616.     /**
  617.      * Convert a text value into a DBMS specific format that is suitable to
  618.      * compose query statements.
  619.      *
  620.      * @param resource  $prepared_query query handle from prepare()
  621.      * @param           $parameter
  622.      * @param           $clob
  623.      * @return string  text string that represents the given argument value in
  624.      *                 a DBMS specific format.
  625.      * @access public
  626.      */
  627.     function getClobValue($prepared_query, $parameter, $clob)
  628.     {
  629.         // take this from the corresponding Metabase driver: GetCLOBFieldValue()
  630.     }
  631.  
  632.     // }}}
  633.     // {{{ freeClobValue()
  634.  
  635.     /**
  636.      * free a chracter large object
  637.      *
  638.      * @param resource  $prepared_query query handle from prepare()
  639.      * @param string    $clob
  640.      * @param string    $value
  641.      * @return MDB_OK
  642.      * @access public
  643.      */
  644.     function freeClobValue($prepared_query, $clob, &$value)
  645.     {
  646.         // take this from the corresponding Metabase driver: FreeClobValue()
  647.     }
  648.  
  649.     // }}}
  650.     // {{{ getBlobValue()
  651.  
  652.     /**
  653.      * Convert a text value into a DBMS specific format that is suitable to
  654.      * compose query statements.
  655.      *
  656.      * @param resource  $prepared_query query handle from prepare()
  657.      * @param           $parameter
  658.      * @param           $blob
  659.      * @return string  text string that represents the given argument value in
  660.      *                 a DBMS specific format.
  661.      * @access public
  662.      */
  663.     function getBlobValue($prepared_query, $parameter, $blob)
  664.     {
  665.         // take this from the corresponding Metabase driver: GetBLOBFieldValue()
  666.     }
  667.  
  668.     // }}}
  669.     // {{{ freeBlobValue()
  670.  
  671.     /**
  672.      * free a binary large object
  673.      *
  674.      * @param resource  $prepared_query query handle from prepare()
  675.      * @param string    $blob
  676.      * @return MDB_OK
  677.      * @access public
  678.      */
  679.     function freeBlobValue($prepared_query, $blob)
  680.     {
  681.         // take this from the corresponding Metabase driver: FreeBlobValue()
  682.     }
  683.  
  684.     // }}}
  685.     // {{{ nextId()
  686.  
  687.     /**
  688.      * returns the next free id of a sequence
  689.      *
  690.      * @param string  $seq_name name of the sequence
  691.      * @param boolean $ondemand when true the seqence is
  692.      *                          automatic created, if it
  693.      *                          not exists
  694.      *
  695.      * @return mixed MDB_Error or id
  696.      * @access public
  697.      */
  698.     function nextId($seq_name, $ondemand = FALSE)
  699.     {
  700.         // take this from the corresponding PEAR DB driver: nextId()
  701.     }
  702.  
  703.  
  704.     // }}}
  705.     // {{{ currId()
  706.  
  707.     /**
  708.      * returns the current id of a sequence
  709.      *
  710.      * @param string  $seq_name name of the sequence
  711.      * @return mixed MDB_Error or id
  712.      * @access public
  713.      */
  714.     function currId($seq_name)
  715.     {
  716.         // take this from the corresponding Metabase driver: GetSequenceCurrentValue()
  717.     }
  718.  
  719.     // }}}
  720.     // {{{ fetchInto()
  721.  
  722.     /**
  723.      * Fetch a row and insert the data into an existing array.
  724.      *
  725.      * @param resource  $result     result identifier
  726.      * @param int       $fetchmode  how the array data should be indexed
  727.      * @param int       $rownum     the row number to fetch
  728.      * @return int data array on success, a MDB error on failure
  729.      * @access public
  730.      */
  731.     function fetchInto($result, $fetchmode = MDB_FETCHMODE_DEFAULT, $rownum = 0)
  732.     {
  733.         // take this from the corresponding Metabase driver: FetchResultArray()
  734.         // possibly you also need to take code from Metabases FetchRow() method
  735.         // note Metabases FetchRow() method should not be confused with MDB's fetchRow()
  736.     }
  737.  
  738.     // }}}
  739.     // {{{ nextResult()
  740.  
  741.     /**
  742.      * Move the internal mysql result pointer to the next available result
  743.      * Currently not supported
  744.      *
  745.      * @param a valid result resource
  746.      * @return true if a result is available otherwise return false
  747.      * @access public
  748.      */
  749.     function nextResult($result)
  750.     {
  751.         // take this from the corresponding PEAR DB driver: nextResult()
  752.     }
  753.  
  754.     // }}}
  755.     // {{{ tableInfo()
  756.  
  757.     /**
  758.     * returns meta data about the result set
  759.     *
  760.     * @param resource    $result    result identifier
  761.     * @param mixed $mode depends on implementation
  762.     * @return array an nested array, or a MDB error
  763.     * @access public
  764.     */
  765.     function tableInfo($result, $mode = NULL) {
  766.         // take this from the corresponding PEAR DB driver: tableInfo()
  767.     }
  768. }
  769.  
  770. ?>