$query = 'SELECT * FROM tx_myext_table WHERE uid=' . intval($recordUid); $clause = BackendUtility::versioningPlaceholderClause('tx_myext_table'); $result = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows($query . $clause, [], $queryParameters);
$query = 'UPDATE tx_myext_table SET field1=1, field2=2 WHERE uid=' . intval($recordUid); $clause = BackendUtility::versioningPlaceholderClause('tx_myext_table'); $GLOBALS['TYPO3_DB']->exec_UPDATEquery($query . $clause, $queryParameters);In this example, we are updating two fields in a record from the tx_myext_table table. We use the BackendUtility versioningPlaceholderClause to add a versioning clause to the query, which will ensure that the update only affects live versions of the record. We then execute the query using the TYPO3 database API. The BackendUtility versioningPlaceholderClause function is part of the TYPO3 CMS backend utility library, which is included as a package in the TYPO3 core.