ronzonko Posted January 13, 2007 Share Posted January 13, 2007 help needed translating this code so it works under MYSQL5. At the moment it works fine under MYSQL4. It is from the contribution ‘category specials’. I have indentified this following code as causing the problem but my knowledge of MYSQL isn’t up to solving where the joins go (I have tried). Also I am interested about what the D, E, and F are – they seem to be virtual tables created on the fly for solving things. $categ_id = $sInfo->categ_id; $specials_query_raw = "select A.products_id, B.products_name, A.products_price, C.specials_id, C.specials_new_products_price, C.specials_date_added, C.specials_last_modified, C.expires_date, C.date_status_change, C.status, F.special_id from " . TABLE_PRODUCTS . " A, " . TABLE_PRODUCTS_DESCRIPTION . " B , products_to_categories E left join " . TABLE_SPECIALS . "C on C.products_id = A.products_id left join special_product F on A.products_id = F.product_id left join special_category D on E.categories_id = D.categ_id where E.categories_id = $categ_id and E.products_id = A.products_id and A.products_id = B.products_id and B.language_id = '" . (int)$languages_id . "' order by F.special_id, C.specials_id, B.products_name "; ******************************************************************** Link to comment Share on other sites More sharing options...
ddp Posted January 13, 2007 Share Posted January 13, 2007 help needed translating this code so it works under MYSQL5. At the moment it works fine under MYSQL4. It is from the contribution ‘category specials’. I have indentified this following code as causing the problem but my knowledge of MYSQL isn’t up to solving where the joins go (I have tried). Also I am interested about what the D, E, and F are – they seem to be virtual tables created on the fly for solving things. $categ_id = $sInfo->categ_id; $specials_query_raw = "select A.products_id, B.products_name, A.products_price, C.specials_id, C.specials_new_products_price, C.specials_date_added, C.specials_last_modified, C.expires_date, C.date_status_change, C.status, F.special_id from " . TABLE_PRODUCTS . " A, " . TABLE_PRODUCTS_DESCRIPTION . " B , products_to_categories E left join " . TABLE_SPECIALS . "C on C.products_id = A.products_id left join special_product F on A.products_id = F.product_id left join special_category D on E.categories_id = D.categ_id where E.categories_id = $categ_id and E.products_id = A.products_id and A.products_id = B.products_id and B.language_id = '" . (int)$languages_id . "' order by F.special_id, C.specials_id, B.products_name "; ******************************************************************** I know there is this contribution to make osc work on php 5 http://www.oscommerce.com/community/contri...all/search,php5 I think there might be othere too. Hope this helps. Backup before making changes. Backup before making changes! Backup before making changes!! You did do a backup? eh? Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.