TYPO3_DB - Database API
QUERY
$GLOBALS['TYPO3_DB']->store_lastBuiltQuery = 1; $selectFields = '*'; $fromTable = ''; $whereClause = '1'; $groupBy = ''; $orderBy = ''; // 'field(uid,' . $orderedUidList . ')'; $limit = ''; $recordList = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows( $selectFields, $fromTable, $whereClause.$this->cObj->enableFields($fromTable), $groupBy, $orderBy, $limit, ); debug(array( 'fields' => $selectFields, 'from' => $fromTable, 'where' => $whereClause, 'enable' => $this->cObj->enableFields($fromTable), 'group' => $groupBy, 'order' => $orderBy, 'limit' => $limit, 'query' => $GLOBALS['TYPO3_DB']->debug_lastBuiltQuery, 'recordList' => $recordList, ),'SELECT',__LINE__,__FILE__); // direkte Weiter-Verarbeitung: foreach ((array)$recordList as $record) { $record['uid']; $translatedRecord = $GLOBALS['TSFE']->sys_page->getRecordOverlay( $fromTable, $record, $GLOBALS['TSFE']->sys_language_uid, $GLOBALS['TSFE']->config['config']['sys_language_overlay'], ); }
INSERT
$into_table = ''; $field_values = array( 'fieldname1' => $value1, 'fieldname2' => $value2, 'fieldname3' => $value3, 'fieldname4' => $value4, 'fieldname5' => $value5, 'tstamp' => time(), 'crdate' => time(), ); $res=$GLOBALS['TYPO3_DB']->exec_INSERTquery( $into_table, $field_values, ); $newUId = $GLOBALS['TYPO3_DB']->sql_insert_id();
UPDATE
$into_table = ''; $where_clause = ''; $field_values = array( 'fieldname1' => $value1, 'fieldname2' => $value2, 'fieldname3' => $value3, 'fieldname4' => $value4, 'fieldname5' => $value5, 'tstamp' => time(), ); $res = $GLOBALS['TYPO3_DB']->exec_UPDATEquery( $into_table, $where_clause, $field_values, ); $cnt = $GLOBALS['TYPO3_DB']->sql_affected_rows(); // $cnt : Anzahl betroffener Datensätze
DELETE
$from_table = ''; $where_clause = ''; $res = $GLOBALS['TYPO3_DB']->exec_DELETEquery( $from_table, $where_clause, ); $cnt = $GLOBALS['TYPO3_DB']->sql_affected_rows(); // $cnt : Anzahl betroffener Datensätze