I've seen this problem before - it has to do with the mysql syntax and adding brackets in newer versions of mysql.
this is the code that worked fo me:
$products_query_raw = "select distinct p.products_id, p.products_image, p.products_model, p.products_quantity, p.products_weight, pd.products_name, p.manufacturers_id, p.products_price, p.products_date_added, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price, m.manufacturers_name, pd.products_description, cd.categories_name, p.products_tax_class_id, p2c.categories_id from (" . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c) left join " . TABLE_CATEGORIES_DESCRIPTION . " cd on p2c.categories_id = cd.categories_id left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . $languages_id . "' and cd.language_id = '" . $languages_id . "' order by $order";
Note the added open and close brackets "(" & ")" near TABLE_PRODUCTS_DESCRIPTION and TABLE_PRODUCTS_TO_CATEGORIES.
Change this in both catalog_products_with_images.php & in catalog_products_with_images_full.php
Hope this helps!
And Thanks for the great contrib!