Skip to content

Instantly share code, notes, and snippets.

@freen
Last active December 15, 2015 14:08
Show Gist options
  • Save freen/5272020 to your computer and use it in GitHub Desktop.
Save freen/5272020 to your computer and use it in GitHub Desktop.
ZF2 Zend\Db\Sql should know (for the MySQL platform) that OFFSET has to follow LIMIT.
<?php
// ...
// This works:
$select->from($table)
->group('id')
->limit($limit)
->offset($offset);
// This produces a MySQL exception:
$select->from($table)
->group('id')
->offset($offset)
->limit($limit);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment