Posts by EtienneWebCustoms

    To be precise, $best_sellers becomes false instead of ADORecordSet



    Code
    1. ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'p.products_ordered > 0 AND (o2s.store_1 = 1 OR o2s.store_all = 1) AND p.product' at line 1

    The method RecordCount exists only for classes of type ADORecordSet. The SelectLimit method does not always return such a set, according to this page.


    When it's caused by an SQL error (or missing tables, which could also be the cause of SQL errors), then that'd be a bug as well - since I'm using the default installation, and everything *should* work 'out of the box'. :D

    Hi,


    I'm using the HHG-Multistore CE, version 4.10.2 (latest available).


    Internally, the ADO method SelectLimit is used, and then a RecordCount method is called to see how many were selected. However, if no records were selected (the query 'failed'), it will return false (instead of the result). This will result in the page not being able to render correctly (because it'll crash).


    Therefore, in `core/classes/class.product.php:600`, I had to change

    PHP: core/classes/class.product.php
    1. if ($best_sellers->RecordCount() >= MIN_DISPLAY_BESTSELLERS) {


    into


    PHP: core/classes/class.product.php
    1. if ($best_sellers && $best_sellers->RecordCount() >= MIN_DISPLAY_BESTSELLERS) {