|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2015-11-20 11:10 UTC] s7g2vp2 at yahoo dot co dot uk
Description: ------------ While testing our app using PHP7RC7 we noticed some of the SQL statements failed to return a result set. After some investigation it appears that the syntax LIMIT x OFFSET y causes a problem. The alternative syntax LIMIT y,x does appear to work. We are using MySQLi driver and prepared statements. The LIMIT & OFFSET values are part of the statement and not bound. All statements work in previous versions of PHP and also work in MySQL Workbench. PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 08 22:00:01 2025 UTC |
Are you getting a MySQL error? A common cause of this is that you are sending something than a positive integer as the offset. For example, if you are doing something like: $offset = ceil($page * 10); $offset is now a float because ceil() always returns a float and the driver will pass that as something like "10.0" which will make offset fail. Make sure you cast any offsets you substitute into your query to an int first. eg. $offset = (int)ceil($page * 10);