Community Add-Ons
| Maintainers: | e_covert |
Too Many Split Page Results
for osCommerce Online Merchant v2.2
I had an error on my site where a particular portion that made use of the "splitPageResults" class was indicating far more results/result pages than there actually were. The "splitPageResults" class checks the query that is passed to it for the existance of certain keywords ("from", "group by", "having", "order by", and "distinct"). It uses it's findings to build a new query designed to simply count the results of the original query. However, it was only checking for the existance of these keywords in lowercase.
This modification allows for the safe use of upper case sql keywords in queries that are filtered through the "splitPageResults" class. This is accomplished by creating an additional variable in the class to store the query in forced lower case (ie: strtolower($query) ). Then that variable is used as the one to check against for the existence of the sql keywords.
Please be sure to backup any files you are going to modify and read the attached installation instructions.
Further Fix to handle correctly the split of a query including group by.
In short, the count checking how many rows are returned in order to calculate the number of pages required for the split display
was counting the individual row returned by the listing query WITHOUT the group by.
Obviously this is different from the actual number of row that will be shown with the group by so more page results than necessary were shown.
