From 95ebbc985a0e64a364e880de89dbc1ae7952d91e Mon Sep 17 00:00:00 2001 From: till Date: Sun, 3 Feb 2008 12:58:34 +0000 Subject: * putting latest MDB2 into SVN * adding MDB2 drivers for mssql, mysql, mysqli, pgsql, sqlite --- program/lib/MDB2/Driver/Function/mysql.php | 120 +++++++++++++++++++++++++++++ 1 file changed, 120 insertions(+) create mode 100644 program/lib/MDB2/Driver/Function/mysql.php (limited to 'program/lib/MDB2/Driver/Function/mysql.php') diff --git a/program/lib/MDB2/Driver/Function/mysql.php b/program/lib/MDB2/Driver/Function/mysql.php new file mode 100644 index 000000000..90dea8174 --- /dev/null +++ b/program/lib/MDB2/Driver/Function/mysql.php @@ -0,0 +1,120 @@ + | +// +----------------------------------------------------------------------+ +// +// $Id: mysql.php,v 1.11 2007/01/12 11:29:12 quipo Exp $ +// + +require_once 'MDB2/Driver/Function/Common.php'; + +/** + * MDB2 MySQL driver for the function modules + * + * @package MDB2 + * @category Database + * @author Lukas Smith + */ +class MDB2_Driver_Function_mysql extends MDB2_Driver_Function_Common +{ + // }}} + // {{{ executeStoredProc() + + /** + * Execute a stored procedure and return any results + * + * @param string $name string that identifies the function to execute + * @param mixed $params array that contains the paramaters to pass the stored proc + * @param mixed $types array that contains the types of the columns in + * the result set + * @param mixed $result_class string which specifies which result class to use + * @param mixed $result_wrap_class string which specifies which class to wrap results in + * @return mixed a result handle or MDB2_OK on success, a MDB2 error on failure + * @access public + */ + function &executeStoredProc($name, $params = null, $types = null, $result_class = true, $result_wrap_class = false) + { + $db =& $this->getDBInstance(); + if (PEAR::isError($db)) { + return $db; + } + + $query = 'CALL '.$name; + $query .= $params ? '('.implode(', ', $params).')' : '()'; + return $db->query($query, $types, $result_class, $result_wrap_class); + } + + // }}} + // {{{ concat() + + /** + * Returns string to concatenate two or more string parameters + * + * @param string $value1 + * @param string $value2 + * @param string $values... + * @return string to concatenate two strings + * @access public + **/ + function concat($value1, $value2) + { + $args = func_get_args(); + return "CONCAT(".implode(', ', $args).")"; + } + + // }}} + // {{{ guid() + + /** + * Returns global unique identifier + * + * @return string to get global unique identifier + * @access public + */ + function guid() + { + return 'UUID()'; + } + + // }}} +} +?> \ No newline at end of file -- cgit v1.2.3