modelsManager limit and offset problem

Hi all,

i have an sql ;

SELECT Product.like, commentcount, title, pricelower, price, image, AffiliateOffers.name, payoutyuzde, payoutnakit, payouttype, likedusers, xmlid, brand, model, AffiliateCompanies.trackingid, Product.url FROM [Product] JOIN [AffiliateOffers] ON Product.affid = AffiliateOffers.afid AND Product.offerid = AffiliateOffers.afofferid JOIN [AffiliateCompanies] ON AffiliateCompanies.afid = AffiliateOffers.afid WHERE Product.status = 1 ORDER BY lastlike_time desc LIMIT 0 OFFSET 20

its created with

$padza = $this->modelsManager->createBuilder() ->columns(array('Product.like','commentcount','title','pricelower','price','image','AffiliateOffers.name','payoutyuzde','payoutnakit','payouttype','likedusers','xmlid','brand','model','AffiliateCompanies.trackingid','Product.url')) ->from('Product') ->join('AffiliateOffers','Product.affid = AffiliateOffers.afid AND Product.offerid = AffiliateOffers.afofferid') ->join('AffiliateCompanies','AffiliateCompanies.afid = AffiliateOffers.afid') ->where('Product.status = 1') ->limit(0,20) ->orderBy('lastlike_time desc') ->getPhql();

That code

its working okey, but i edited sql , edited limit and offset

$newsql = ' SELECT Product.like, commentcount, title, pricelower, price, image, AffiliateOffers.name, payoutyuzde, payoutnakit, payouttype, likedusers, xmlid, brand, model, AffiliateCompanies.trackingid, Product.url FROM [Product] JOIN [AffiliateOffers] ON Product.affid = AffiliateOffers.afid AND Product.offerid = AffiliateOffers.afofferid JOIN [AffiliateCompanies] ON AffiliateCompanies.afid = AffiliateOffers.afid WHERE Product.status = 1 ORDER BY lastliketime desc';

$new_sql .= ' LIMIT :limit OFFSET :offset';

$products = $this->modelsManager->executeQuery($new_sql,array('limit'=>21, 'offset' => 20));

products working and get products but no limit? all products its fetching

Thanks for all



23.6k

and now i find that , after i get phql i couldnt work it with executeQuery()

how can i solve that ?

I met such a problem (compiled phalcon on ubuntu), decided install from repository.