[TYPO3-english] pi_exec_query and $addWhere parameter

Andrea Schmuttermair abo at schmutt.de
Fri Sep 9 14:54:52 CEST 2011


Hi,

you can try these Database Functions: 
$GLOBALS['TYPO3_DB']->exec_SELECTgetRows

Page is in German, but Example should be fine:
http://www.pi-phi.de/database-api.html

Regards,
Andrea


Am 07.09.2011 21:13, schrieb Piotr Burda:
> Hi group
> I need to add some parameters to a query in my own extension (simple
> list of products)
> I need to add:
> $addWhere = 'AND categories LIKE "%spo%"';
>
> all code for query:
> $addWhere = 'AND categories LIKE "%spo%"';
> $count = 1;
> list($this->internal['orderBy'],$this->internal['descFlag']) =
> explode(':',$this->piVars['sort']);
> $this->internal['results_at_a_time']=t3lib_div::intInRange($lConf['results_at_a_time'],0,1000,15);
> // Number of results to show in a listing.
> $this->internal['maxPages']=t3lib_div::intInRange($lConf['maxPages'],0,1000,2);;
> // The maximum number of "pages" in the browse-box: "Page 1", "Page 2",
> etc.
> $this->internal['searchFieldList']='name,categories';
> $this->internal['orderByList']='uid';
>
> // Get number of records:
> $res =
> $this->pi_exec_query('tx_pbproductskasyfiskalne_kasy_fiskalne',$count,$addWhere);
>
> list($this->internal['res_count']) =
> $GLOBALS['TYPO3_DB']->sql_fetch_row($res);
>
> But it doesn`t work, as result i have full list of products.
>
> PLS help to resolve this problem
>
> Regards
> Piotr
>



More information about the TYPO3-english mailing list