[TYPO3] Deleting records from the back end

Dmitry Dulepov [typo3] dmitry at typo3.org
Mon Jun 9 09:16:20 CEST 2008


Hi!

Stephen Bungert wrote:
> Why does this not work?
> 
> // Check if something has been deleted
> if ($this->delCheck) {
> 	$changes = array(
> 		'deleted' => 0,
> 		);
> 	 $GLOBALS['TYPO3_DB']->UPDATEquery('tx_metri_secure_log', 'uid=' .
> $this->delCheck, $changes);
> }

Look into the description of UPDATEquery. It only generates the query, it does not execute anything.

> It doesn't change the deleted field to 1.

Well, it never will, your $changes set 'deleted' to 0 :D

In real life you should use TCEmain for deleting records. Otherwise you damage reference index and no hooks will be called on delete.

-- 
Dmitry Dulepov
Learn more about TYPO3: http://typo3bloke.net/


More information about the TYPO3-english mailing list