Hello,
I’m new with cakephp 3 and I don’t know how can I do this SQL query:
SELECT n1.mot, r.nomc, n2.mot, d.def
FROM `aretes` as a, `noeuds` as n1, `noeuds` as n2, `definitions` as d, `relations` as r
WHERE a.mot1 = n1.id and
a.mot2 = n2.id and
a.rel = r.id and
n1.id = d.noeud_id and
n1.id = 41114
group by a.rel
order by n2.poids desc
I have a fix for paginator, I use a different one where I have full control. See this paginator and learn how to use it, I have used in asp.ner, jsp / servlets, just had to change the language etc
There are instructions in the comments how to use skip take —
/**
* getLimit2 and getPerPage are used together
* when using the Eloquent Query Builder
* for the skip and take parameters.
*
* There are also other ORM's that need the skip and take
* parameters separated.
*
* Example in controller method calling model method:
*
* $data['pets'] = $this->pet->getPets($pages->getLimit2(), $pages->getPerPage(), $petSearch);
*
* Example model method using Eloquent Query Builder:
*
* public function getPets($offset = "", $rowsPerPage = "", $petSearch = "")
* {
* $petsearch = $petsearch . "%";
*
* return Capsule::table('pets')
* ->where('petName', 'like', $petsearch)
* ->orderBy('petName', 'asc')
* ->skip($offset)->take($rowsPerPage)->get();
* }
*
* Also see the file in the helpers folder page_eloq.md for more help.
*
If you need more help just start a new topic, but believe me this is a good paginator.