se qualche anima pia volesse gentilmente
aiutarmi nella correzione delle query .... ne sarei infinitivamente grato.
sto' creando un progetto (oramai da un annetto abbondante) per un e-commerce
WAI con licenga GPL2, pero' per quanto riguarda le conoscenze mysql...
faccio un po' pena.
ho il codice funzionante su mysql 4, ma non se ne parla di farlo andare su
mysql 5.
// versione che naturalmente va solo per mysql4, PERCHE ' ?
$listing_sql = "select " . $select_column_list . " p.products_id,
p.manufacturers_id, p.products_price, p.products_tax_class_id, 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
from " . TABLE_PRODUCTS ." p
left join " . TABLE_SPECIALS . " s on (p.products_id = s.products_id)
<--- AGGIUNTA --->
left join " . TABLE_CATEGORIES . " c on (p2c.categories_id = c.categories_id),
<--- fine aggiunta --->
" . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " .
TABLE_PRODUCTS_TO_CATEGORIES . " p2c
where
<--- aggiunta --->
c.categories_status = '1' and p.products_status = '1'
and
<--- fine aggiunta --->
p.manufacturers_id = m.manufacturers_id
and
m.manufacturers_id = '" . (int)$_GET['manufacturers_id'] . "'
and
p.products_id = p2c.products_id
and
pd.products_id = p2c.products_id
and
pd.language_id = '" . (int)$languages_id . "'
and
p2c.categories_id = '" . (int)$_GET['filter_id'] . "'";
il problema sta' nel secondo left join, se tolgo le aggiunte funziona tutto su entrambi i mysql.... ma mi serve anche l'aggiunta.
aiutino please...![]()