[TYPO3-english] pi_exec_query and $addWhere parameter
Piotr Burda
pburda at typo3job.com
Wed Sep 7 21:13:05 CEST 2011
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