[Typo3-dev] Is cObj->DBgetInsert going to be obsolete?
Martin Kutschker
martin.kutschker-n0spam at no5pam-blackbox.net
Sun Aug 14 10:29:12 CEST 2005
Elmar Hinz schrieb:
> Hello all,
>
> I have a question concerning best practice for insert queries from the
> frontend. This seems to be a standard task, but definite documentation
> is rare.
>
>
> News documents tell to use DBAL for DB stuff:
>
> $query = $GLOBALS['TYPO3_DB']->INSERTquery($table, $insertVars);
> $res = $GLOBALS['TYPO3_DB']->sql(TYPO3_db, $query);
$GLOBALS['TYPO3_DB']->sql(TYPO3_db, $query) is deprecated. It should
have never been in t3lib_db at all. Note the TYPOP3_db argument is
bogus. It isn't used by the function :-)
Use $GLOBALS['TYPO3_DB']->sql_query($query) instead.
Or use this: $GLOBALS['TYPO3_DB']-> exec_INSERTquery($table,$fields_values)
> On the other hand the only function I find for FE that considers the
> handling of "system-fields" according to $TCA is:
>
> $this->cObj->DBgetInsert($table, $pid, $dataArr, $fieldList, $addSlashes=0)
>
> Will DBgetInsert implement DBAl or is it rather an obsolete Function?
Ever cared to look at the source code? I you had a look at the function
you would have noticed it uses (as all core functions do!)
$GLOBALS['TYPO3_DB'] for database access.
So you can use this function. It is currently not deprecated.
Masi
More information about the TYPO3-dev
mailing list