Project

General

Profile

Bug #16751 » 0004581.patch

Administrator Admin, 2006-12-15 12:11

View differences:

t3lib/class.t3lib_db.php (Arbeitskopie)
}
/**
* Returns some information about actions that were performed
* after an UPDATE or DELETE query was sent to the database.
* All keys of the array are lowercased and whitspaces are removed.
* The returned array looks like this:
* Array('rowsmatched' => 1, 'changed' => 1, 'warnings' => 0)
*
* @return array And accociative array with information about the performed actions.
*/
function sql_info() {
$info = array();
$sql_info = strtolower(mysql_info($this->link));
while (preg_match('/(\w[\w\s]+):\s+(\d+)\s*/', $sql_info, $matches)) {
$sql_info = str_replace($matches[0], '', $sql_info);
$matches[1] = str_replace(' ', '', $matches[1]);
$info[$matches[1]] = $matches[2];
}
return $info;
}
/**
* Move internal result pointer
* mysql_data_seek() wrapper function
* Usage count/core: 3
t3lib/class.t3lib_tstemplate.php (Arbeitskopie)
);
$mpvar_hash = t3lib_div::md5int($GLOBALS['TSFE']->MP);
$GLOBALS['TYPO3_DB']->exec_UPDATEquery('cache_pagesection', 'page_id=' . intval($GLOBALS['TSFE']->id) . ' AND mpvar_hash=' . $mpvar_hash, $dbFields);
if ($GLOBALS['TYPO3_DB']->sql_affected_rows() == 0) {
// get some information about the last performed SQL query
$sql_info = $GLOBALS['TYPO3_DB']->sql_info();
if ($sql_info['rowsmatched'] == 0) {
$dbFields['page_id'] = intval($GLOBALS['TSFE']->id);
$dbFields['mpvar_hash'] = $mpvar_hash;
$GLOBALS['TYPO3_DB']->exec_INSERTquery('cache_pagesection', $dbFields);
(2-2/2)