Skip to content

Instantly share code, notes, and snippets.

@rsandrade
Created June 4, 2018 01:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rsandrade/d55aff0b9ba83ca08821329a8d5b679e to your computer and use it in GitHub Desktop.
Save rsandrade/d55aff0b9ba83ca08821329a8d5b679e to your computer and use it in GitHub Desktop.
LIMIT e OFFSET em LEFT JOIN
$f3->set('res_institutions', $f3->get('db')->exec(
'SELECT Institutions.id, Institutions.name, Institutions.country, Users_Institutions.id AS iduserinst FROM Institutions ' .
'LEFT JOIN Users_Institutions ON Users_Institutions.iduser = ' . $f3->get('SESSION.id')[0]['id'] . ' ' .
'AND Users_Institutions.idinstitution = ' . $f3->get('PARAMS.id') . ' ' .
'LIMIT ' . $f3->get('GET.qty') . ' ' .
'OFFSET ' . $f3->get('GET.since')
));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment