From: <var...@us...> - 2021-09-06 17:10:44
|
Revision: 10544 http://sourceforge.net/p/phpwiki/code/10544 Author: vargenau Date: 2021-09-06 17:10:42 +0000 (Mon, 06 Sep 2021) Log Message: ----------- Add braces, rename $offset to $from Modified Paths: -------------- trunk/lib/WikiDB/backend/PDO_mysql.php trunk/lib/WikiDB/backend/PDO_pgsql.php Modified: trunk/lib/WikiDB/backend/PDO_mysql.php =================================================================== --- trunk/lib/WikiDB/backend/PDO_mysql.php 2021-09-06 17:08:49 UTC (rev 10543) +++ trunk/lib/WikiDB/backend/PDO_mysql.php 2021-09-06 17:10:42 UTC (rev 10544) @@ -99,19 +99,19 @@ /* * offset specific syntax within mysql - * convert from,count to SQL "LIMIT $offset, $count" + * convert from,count to SQL "LIMIT $from, $count" */ function _limit_sql($limit = false) { if ($limit) { - list($offset, $count) = $this->limit($limit); - if ($offset) - // pgsql needs "LIMIT $count OFFSET $from" - $limit = " LIMIT $offset, $count"; - else + list($from, $count) = $this->limit($limit); + if ($from) { + $limit = " LIMIT $from, $count"; + } else { $limit = " LIMIT $count"; - } else + } else { $limit = ''; + } return $limit; } Modified: trunk/lib/WikiDB/backend/PDO_pgsql.php =================================================================== --- trunk/lib/WikiDB/backend/PDO_pgsql.php 2021-09-06 17:08:49 UTC (rev 10543) +++ trunk/lib/WikiDB/backend/PDO_pgsql.php 2021-09-06 17:10:42 UTC (rev 10544) @@ -30,25 +30,27 @@ class WikiDB_backend_PDO_pgsql extends WikiDB_backend_PDO { + function backendType() + { + return 'pgsql'; + } /* + * offset specific syntax within pgsql * convert from,count to SQL "LIMIT $count OFFSET $from" */ function _limit_sql($limit = false) { if ($limit) { - list($offset, $count) = $this->limit($limit); - if ($offset) - $limit = " LIMIT $count OFFSET $offset"; - else + list($from, $count) = $this->limit($limit); + if ($from) { + $limit = " LIMIT $count OFFSET $from"; + } else { $limit = " LIMIT $count"; - } else + } else { $limit = ''; + } return $limit; } - function backendType() - { - return 'pgsql'; - } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |