⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 common.php

📁 太烦了
💻 PHP
📖 第 1 页 / 共 5 页
字号:
    }    // }}}    // {{{ commit()    /**     * starts a Commit     *     * @return mixed DB_Error     *     * @access public     */    function commit()    {        return $this->raiseError(DB_ERROR_NOT_CAPABLE);    }    // }}}    // {{{ rollback()    /**     * starts a rollback     *     * @return mixed DB_Error     *     * @access public     */    function rollback()    {        return $this->raiseError(DB_ERROR_NOT_CAPABLE);    }    // }}}    // {{{ numRows()    /**     * Returns the number of rows in a result object     *     * @param object DB_Result the result object to check     *     * @return mixed DB_Error or the number of rows     *     * @access public     */    function numRows($result)    {        return $this->raiseError(DB_ERROR_NOT_CAPABLE);    }    // }}}    // {{{ affectedRows()    /**     * Returns the affected rows of a query     *     * @return mixed DB_Error or number of rows     *     * @access public     */    function affectedRows()    {        return $this->raiseError(DB_ERROR_NOT_CAPABLE);    }    // }}}    // {{{ errorNative()    /**     * Returns an errormessage, provides by the database     *     * @return mixed DB_Error or message     *     * @access public     */    function errorNative()    {        return $this->raiseError(DB_ERROR_NOT_CAPABLE);    }    // }}}    // {{{ getSequenceName()    /**     * Generate the name used inside the database for a sequence     *     * The createSequence() docblock contains notes about storing sequence     * names.     *     * @param string $sqn  the sequence's public name     *     * @return string  the sequence's name in the backend     *     * @see DB_common::createSequence(), DB_common::dropSequence(),     *      DB_common::nextID(), DB_common::setOption()     * @access private     */    function getSequenceName($sqn)    {        return sprintf($this->getOption('seqname_format'),                       preg_replace('/[^a-z0-9_.]/i', '_', $sqn));    }    // }}}    // {{{ nextId()    /**     * Returns the next free id in a sequence     *     * @param string  $seq_name  name of the sequence     * @param boolean $ondemand  when true, the seqence is automatically     *                           created if it does not exist     *     * @return int  the next id number in the sequence.  DB_Error if problem.     *     * @see DB_common::createSequence(), DB_common::dropSequence(),     *      DB_common::getSequenceName()     * @access public     */    function nextId($seq_name, $ondemand = true)    {        return $this->raiseError(DB_ERROR_NOT_CAPABLE);    }    // }}}    // {{{ createSequence()    /**     * Creates a new sequence     *     * The name of a given sequence is determined by passing the string     * provided in the <var>$seq_name</var> argument through PHP's sprintf()     * function using the value from the <var>seqname_format</var> option as     * the sprintf()'s format argument.     *     * <var>seqname_format</var> is set via setOption().     *     * @param string $seq_name  name of the new sequence     *     * @return int  DB_OK on success.  A DB_Error object is returned if     *              problems arise.     *     * @see DB_common::dropSequence(), DB_common::getSequenceName(),     *      DB_common::nextID()     * @access public     */    function createSequence($seq_name)    {        return $this->raiseError(DB_ERROR_NOT_CAPABLE);    }    // }}}    // {{{ dropSequence()    /**     * Deletes a sequence     *     * @param string $seq_name  name of the sequence to be deleted     *     * @return int  DB_OK on success.  DB_Error if problems.     *     * @see DB_common::createSequence(), DB_common::getSequenceName(),     *      DB_common::nextID()     * @access public     */    function dropSequence($seq_name)    {        return $this->raiseError(DB_ERROR_NOT_CAPABLE);    }    // }}}    // {{{ tableInfo()    /**     * Returns information about a table or a result set     *     * The format of the resulting array depends on which <var>$mode</var>     * you select.  The sample output below is based on this query:     * <pre>     *    SELECT tblFoo.fldID, tblFoo.fldPhone, tblBar.fldId     *    FROM tblFoo     *    JOIN tblBar ON tblFoo.fldId = tblBar.fldId     * </pre>     *     * <ul>     * <li>     *     * <kbd>null</kbd> (default)     *   <pre>     *   [0] => Array (     *       [table] => tblFoo     *       [name] => fldId     *       [type] => int     *       [len] => 11     *       [flags] => primary_key not_null     *   )     *   [1] => Array (     *       [table] => tblFoo     *       [name] => fldPhone     *       [type] => string     *       [len] => 20     *       [flags] =>     *   )     *   [2] => Array (     *       [table] => tblBar     *       [name] => fldId     *       [type] => int     *       [len] => 11     *       [flags] => primary_key not_null     *   )     *   </pre>     *     * </li><li>     *     * <kbd>DB_TABLEINFO_ORDER</kbd>     *     *   <p>In addition to the information found in the default output,     *   a notation of the number of columns is provided by the     *   <samp>num_fields</samp> element while the <samp>order</samp>     *   element provides an array with the column names as the keys and     *   their location index number (corresponding to the keys in the     *   the default output) as the values.</p>     *     *   <p>If a result set has identical field names, the last one is     *   used.</p>     *     *   <pre>     *   [num_fields] => 3     *   [order] => Array (     *       [fldId] => 2     *       [fldTrans] => 1     *   )     *   </pre>     *     * </li><li>     *     * <kbd>DB_TABLEINFO_ORDERTABLE</kbd>     *     *   <p>Similar to <kbd>DB_TABLEINFO_ORDER</kbd> but adds more     *   dimensions to the array in which the table names are keys and     *   the field names are sub-keys.  This is helpful for queries that     *   join tables which have identical field names.</p>     *     *   <pre>     *   [num_fields] => 3     *   [ordertable] => Array (     *       [tblFoo] => Array (     *           [fldId] => 0     *           [fldPhone] => 1     *       )     *       [tblBar] => Array (     *           [fldId] => 2     *       )     *   )     *   </pre>     *     * </li>     * </ul>     *     * The <samp>flags</samp> element contains a space separated list     * of extra information about the field.  This data is inconsistent     * between DBMS's due to the way each DBMS works.     *   + <samp>primary_key</samp>     *   + <samp>unique_key</samp>     *   + <samp>multiple_key</samp>     *   + <samp>not_null</samp>     *     * Most DBMS's only provide the <samp>table</samp> and <samp>flags</samp>     * elements if <var>$result</var> is a table name.  The following DBMS's     * provide full information from queries:     *   + fbsql     *   + mysql     *     * If the 'portability' option has <samp>DB_PORTABILITY_LOWERCASE</samp>     * turned on, the names of tables and fields will be lowercased.     *     * @param object|string  $result  DB_result object from a query or a     *                                string containing the name of a table.     *                                While this also accepts a query result     *                                resource identifier, this behavior is     *                                deprecated.     * @param int  $mode   either unused or one of the tableInfo modes:     *                     <kbd>DB_TABLEINFO_ORDERTABLE</kbd>,     *                     <kbd>DB_TABLEINFO_ORDER</kbd> or     *                     <kbd>DB_TABLEINFO_FULL</kbd> (which does both).     *                     These are bitwise, so the first two can be     *                     combined using <kbd>|</kbd>.     * @return array  an associative array with the information requested.     *                If something goes wrong an error object is returned.     *     * @see DB_common::setOption()     * @access public     */    function tableInfo($result, $mode = null)    {        /*         * If the DB_<driver> class has a tableInfo() method, that one         * overrides this one.  But, if the driver doesn't have one,         * this method runs and tells users about that fact.         */        return $this->raiseError(DB_ERROR_NOT_CAPABLE);    }    // }}}    // {{{ getTables()    /**     * @deprecated  Deprecated in release 1.2 or lower     */    function getTables()    {        return $this->getListOf('tables');    }    // }}}    // {{{ getListOf()    /**     * list internal DB info     * valid values for $type are db dependent,     * often: databases, users, view, functions     *     * @param string $type type of requested info     *     * @return mixed DB_Error or the requested data     *     * @access public     */    function getListOf($type)    {        $sql = $this->getSpecialQuery($type);        if ($sql === null) {                                // No support            return $this->raiseError(DB_ERROR_UNSUPPORTED);        } elseif (is_int($sql) || DB::isError($sql)) {      // Previous error            return $this->raiseError($sql);        } elseif (is_array($sql)) {                         // Already the result            return $sql;        }        return $this->getCol($sql);                         // Launch this query    }    // }}}    // {{{ getSpecialQuery()    /**     * Returns the query needed to get some backend info     *     * @param string $type What kind of info you want to retrieve     *     * @return string The SQL query string     *     * @access public     */    function getSpecialQuery($type)    {        return $this->raiseError(DB_ERROR_UNSUPPORTED);    }    // }}}    // {{{ _rtrimArrayValues()    /**     * Right trim all strings in an array     *     * @param array  $array  the array to be trimmed (passed by reference)     * @return void     * @access private     */    function _rtrimArrayValues(&$array)    {        foreach ($array as $key => $value) {            if (is_string($value)) {                $array[$key] = rtrim($value);            }        }    }    // }}}    // {{{ _convertNullArrayValuesToEmpty()    /**     * Convert all null values in an array to empty strings     *     * @param array  $array  the array to be de-nullified (passed by reference)     * @return void     * @access private     */    function _convertNullArrayValuesToEmpty(&$array)    {        foreach ($array as $key => $value) {            if (is_null($value)) {                $array[$key] = '';            }        }    }    // }}}}/* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: */?>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -