Project

General

Profile

Feature #17927 ยป 6988-retrunValueOfPerformUpdateQuery_V2.patch

Administrator Admin, 2007-12-17 09:54

View differences:

t3lib/class.t3lib_install.php (working copy)
*
* @param array Array of SQL queries to execute.
* @param array Array with keys that must match keys in $arr. Only where a key in this array is set and true will the query be executed (meant to be passed from a form checkbox)
* @return void
* @return mixed Array with error message from database if any occured. Otherwise true if everything was executed successfully.
*/
function performUpdateQueries($arr,$keyArr) {
$result = array();
if (is_array($arr)) {
foreach($arr as $key => $string) {
if (isset($keyArr[$key]) && $keyArr[$key]) {
$GLOBALS['TYPO3_DB']->admin_query($string);
$res = $GLOBALS['TYPO3_DB']->admin_query($string);
if ($res === false) {
$result[$key] = $GLOBALS['TYPO3_DB']->sql_error();
} else {
$GLOBALS['TYPO3_DB']->sql_free_result($res);
}
}
}
}
if (count($result) > 0) {
return $result;
} else {
return true;
}
}
/**
    (1-1/1)