* Create a new DB connection object for the specified database
* type
*
- * @param $type string database type, for example "mysql"
+ * @param string $type database type, for example "mysql"
*
- * @return object a newly created DB object, or a DB error code on
+ * @return mixed a newly created DB object, or a DB error code on
* error
+ *
+ * access public
*/
function &factory($type)
* Create a new DB connection object and connect to the specified
* database
*
- * @param $dsn mixed "data source name", see the DB::parseDSN
+ * @param mixed $dsn "data source name", see the DB::parseDSN
* method for a description of the dsn format. Can also be
* specified as an array of the format returned by DB::parseDSN.
*
- * @param $options mixed An associative array of option names and
+ * @param mixed $options An associative array of option names and
* their values. For backwards compatibility, this parameter may
* also be a boolean that tells whether the connection should be
* persistent. See DB_common::setOption for more information on
* connection options.
*
- * @return object a newly created DB connection object, or a DB
+ * @return mixed a newly created DB connection object, or a DB
* error object on error
*
* @see DB::parseDSN
* @see DB::isError
- * @see DB_common::setOption
+ * @see DB_common::setOption
*/
function &connect($dsn, $options = false)
{
* Return the DB API version
*
* @return int the DB API version number
+ *
+ * @access public
*/
function apiVersion()
{
* @param $value int result code
*
* @return bool whether $value is an error
+ *
+ * @access public
*/
function isError($value)
{
*
* @access public
*
- * @param string the query
+ * @param string $query the query
*
- * @return bool whether $query is a data manipulation query
+ * @return boolean whether $query is a data manipulation query
*/
function isManip($query)
{
* Warnings differ from errors in that they are generated by DB,
* and are not fatal.
*
- * @param $value mixed result value
+ * @param mixed $value result value
+ *
+ * @return boolean whether $value is a warning
*
- * @return bool whether $value is a warning
+ * @access public
*/
function isWarning($value)
{
/**
* Return a textual error message for a DB error code
*
- * @param $value int error code
+ * @param integer $value error code
*
* @return string error message, or false if the error code was
* not recognized
/**
* Parse a data source name
*
- * @param $dsn string Data Source Name to be parsed
- *
- * @return array an associative array with the following keys:
- *
+ * A array with the following keys will be returned:
* phptype: Database backend used in PHP (mysql, odbc etc.)
* dbsyntax: Database used with regards to SQL syntax etc.
* protocol: Communication protocol to use (tcp, unix etc.)
* phptype(dbsyntax)
* phptype
*
+ * @param string $dsn Data Source Name to be parsed
+ *
+ * @return array an associative array
+ *
* @author Tomas V.V.Cox <cox@idecnet.com>
*/
function parseDSN($dsn)
*
* @access public
*
- * @param $name the base name of the extension (without the .so or
- * .dll suffix)
+ * @param string $name the base name of the extension (without the .so or
+ * .dll suffix)
*
- * @return bool true if the extension was already or successfully
- * loaded, false if it could not be loaded
+ * @return boolean true if the extension was already or successfully
+ * loaded, false if it could not be loaded
*/
function assertExtension($name)
{
/**
* DB_Error constructor.
*
- * @param $code mixed DB error code, or string with error message.
- * @param $mode int what "error mode" to operate in
- * @param $level what error level to use for $mode & PEAR_ERROR_TRIGGER
- * @param $debuginfo additional debug info, such as the last query
+ * @param mixed $code DB error code, or string with error message.
+ * @param integer $mode what "error mode" to operate in
+ * @param integer $level what error level to use for $mode & PEAR_ERROR_TRIGGER
+ * @param smixed $debuginfo additional debug info, such as the last query
*
* @access public
*
/**
* DB_Warning constructor.
*
- * @param $code mixed DB error code, or string with error message.
- * @param $mode int what "error mode" to operate in
- * @param $level what error level to use for $mode == PEAR_ERROR_TRIGGER
- * @param $debuginfo additional debug info, such as the last query
+ * @param mixed $code DB error code, or string with error message.
+ * @param integer $mode what "error mode" to operate in
+ * @param integer $level what error level to use for $mode == PEAR_ERROR_TRIGGER
+ * @param mmixed $debuginfo additional debug info, such as the last query
*
* @access public
*
/**
* DB_result constructor.
- * @param $dbh DB object reference
- * @param $result result resource id
+ * @param resource $dbh DB object reference
+ * @param resource $result result resource id
*/
function DB_result(&$dbh, $result)
* @param int $rownum the row number to fetch
*
* @return array a row of data, NULL on no more rows or PEAR_Error on error
+ *
+ * @access public
*/
function fetchRow($fetchmode = DB_FETCHMODE_DEFAULT, $rownum=null)
{
/**
* Fetch a row of data into an existing variable.
*
- * @param mixed $arr reference to data containing the row
- * @param int $fetchmode format of fetched row
- * @param int $rownum the row number to fetch
+ * @param mixed $arr reference to data containing the row
+ * @param integer $fetchmode format of fetched row
+ * @param integer $rownum the row number to fetch
*
* @return mixed DB_OK on success, NULL on no more rows or
* a DB_Error object on error
+ *
+ * @access public
*/
function fetchInto(&$arr, $fetchmode = DB_FETCHMODE_DEFAULT, $rownum=null)
{
* Get the the number of columns in a result set.
*
* @return int the number of columns, or a DB error
+ *
+ * @access public
*/
function numCols()
{
* Get the number of rows in a result set.
*
* @return int the number of rows, or a DB error
+ *
+ * @access public
*/
function numRows()
{
* Get the next result if a batch of queries was executed.
*
* @return bool true if a new result is available or false if not.
+ *
+ * @access public
*/
function nextResult()
{
/**
* Frees the resources allocated for this result set.
* @return int error code
+ *
+ * @access public
*/
function free()
{
return true;
}
+ /**
+ * @deprecated
+ */
function tableInfo($mode = null)
{
return $this->dbh->tableInfo($this->result, $mode);
}
+ /**
+ * returns the actual rows number
+ * @return integer
+ */
function getRowCounter()
{
return $this->row_counter;
*/
class DB_row
{
+ /**
+ * constructor
+ *
+ * @param resource row data as array
+ */
function DB_row(&$arr)
{
for (reset($arr); $key = key($arr); next($arr)) {