[TYPO3-mvc] Re: Re: extbase query select only specific table columns

Philipp philippwrann at gmx.at
Wed Apr 10 10:43:15 CEST 2013


Quote: Domi Garms wrote on Tue, 09 April 2013 14:47
----------------------------------------------------
> On 04/09/2013 03:09 PM, Philipp wrote:
> > I dont think so, but if you really need those 2 columns only in a
> > resultarray you may send a raw statement. No need for a mapping process
> > here if you just handle one string and one integer.
> Hi Philipp,
> 
> I did this now:
> 
> $query     = $this->createQuery();
> $selectQuery = 'SELECT id,name FROM mytable'
> $query->statement($selectQuery);
> 
> return $query->execute()->toArray();
> 
> Now my result is still an array of all rows, maybe because of toArray()? 
> How can I get an array from my select without all unnecessary columns?
> 
> Thanks,
> Dominic
----------------------------------------------------

$GLOBALS['TYPO3_DB']->exec_SELECTquery(); i think.... this is the most direct way respecting the DBAL


More information about the TYPO3-project-typo3v4mvc mailing list