[TYPO3-mvc] Failing when insert a record
Xavier Perseguers
xavier at typo3.org
Tue Jun 10 11:45:55 CEST 2014
Hi,
> Fatal error: Call to a member function fetch_assoc() on a non-object in
> C:\wamp\www\typo3art\typo3\sysext\core\Classes\Database\DatabaseConnection.php
> on line 1034
>
> My action is :
>
> $query = $this->createQuery();
> $query->getQuerySettings()->setReturnRawQueryResult(TRUE);
>
> $query->statement("INSERT INTO domain_model_person (pid,
> showdetails ) VALUES
> (136, 0);" );
> return $query->execute();
Don't get why you need this with Extbase but:
$GLOBALS['TYPO3_DB']->exec_INSERTquery(
'domain_model_person',
array(
'pid' => 136,
'showdetails' => 0,
)
);
would be already better and at least DBAL-compatible, what a raw SQL
would not.
Kind regards
--
Xavier Perseguers
TYPO3 CMS Team Member
TYPO3 .... inspiring people to share!
Get involved: http://typo3.org
More information about the TYPO3-project-typo3v4mvc
mailing list