redaxo / redaxo4

REDAXO 4
https://redaxo.org
41 stars 26 forks source link

Update class.rex_sql.inc.php #392

Closed ovo2 closed 9 years ago

ovo2 commented 9 years ago

$sql->hasNext() returns true even if the counter just points to the last row.

gharlan commented 9 years ago

The hasNext function should be used like this:

while ($sql->hasNext()) {
    // ...

    $sql->next();
}

The name is maybe misleading, a better name would be valid(). But the current return value is correct. Otherwise the last row would be skipped.