[TYPO3-mvc] Building my own queries

Dawid Pacholczyk dpacholczyk at gmail.com
Tue Oct 26 16:11:14 CEST 2010


Thanks Dustin. I was looking for that :)

2010/10/26 Dustin Kinney <dustin at kinney.ws>

>  Hey Dawid,
>
>
> $query = $this->createQuery();
> $query->statement("SELECT * FROM yourtable WHERE something = (SELECT
> COUNT(*) FROM anothertable WHERE someotherthing = somevalue)");
> $query->getQuerySettings()->setReturnRawQueryResult(true);
> $result = $query->execute();
>
>
> I use this to create more complex queries (subselects,...). Only used
> SELECT's so far, but i assume it will work with SET and all the other stuff
> as well. Never had a problem with accessing other tables this way.
>
> Cheers
> Dustin Kinney
>
>
> Am 26.10.10 15:33, schrieb Dawid Pacholczyk:
>
>  You didn`t understand me. I know about that. But can I invoke my own
>> select,
>> update or something else on table that isn`t releted with my ext ? For
>> example with this queries I can do all this operation on my Model table.
>> But
>> can I with extbase make an update on fe_users ? Or should I use old
>> $GLOBALS["TYPO3_DB'] ??
>>
>> 2010/10/26 Patrick Broens<patrick at netcreators.com>
>>
>>  On 25-10-2010 14:41, Dawid Pacholczyk wrote:
>>>
>>>> Is there posibility in extbase to create my own query ? For example in
>>>> my
>>>> MyRepository i want to create a method where I can get some data from
>>>> fe_users table or something like that.
>>>>
>>>> Best regards,
>>>> Dawid Pacholczyk
>>>>
>>>>  Hi Dawid,
>>>
>>> There is a lot of documentation online about writing your own queries.
>>> For instance take a look at this cheat sheet:
>>>
>>>
>>> http://www.typovision.de/fileadmin/slides/ExtbaseFluidCheatSheetTypovision.pdf
>>>
>>> Cheers
>>>
>>> Patrick
>>> _______________________________________________
>>> TYPO3-project-typo3v4mvc mailing list
>>> TYPO3-project-typo3v4mvc at lists.typo3.org
>>> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-typo3v4mvc
>>>
>>>
>>
>>  _______________________________________________
> TYPO3-project-typo3v4mvc mailing list
> TYPO3-project-typo3v4mvc at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-typo3v4mvc
>



-- 
Dawid Pacholczyk
tel: 502-054-334
gg: 5564051
skype: dpacholczyk
http://typo3blog.pl (only polish version at the moment)


More information about the TYPO3-project-typo3v4mvc mailing list