Aswathy S Aswathy S - 5 months ago 54
SQL Question

Update table using custom queries in Typo3 Extbase

I have a table named 'user'.I need to update the field 'email' .Is there any custom build queries for updating.I have only the uid of user.

I mean.. Is there any typo3 custom queries equivalent to


Update table 'user' set email = 'new@xyz.com' where uid = 1;


like


$query = $this->createQuery();
$query->matching(
$query->logicalAnd(
$query->equals('organization', $organization),
$query->contains('regions', $region)
)
)
return $query->execute();

Answer

Why don't you use

exec_UPDATEquery    (
    $table,
    $where,
    $fields_values,
    $no_quote_fields = false 
)

Please refer exec_UPDATEquery From TYPO3