Hi,
>Verified table "cactus2_zc2.products_with_attributes_stock" does exist.
Are you absolutely sure it exists? (Check for prefixes)
>Should "Join products_with_attributes_stock PWAS" be "join pa.products_with_attributes_stock PWAS" ??
No - this isn't valid SQL.
Are you using table prefixes - in which case cactus2_zc2.products_with_attributes_stock may really be something like cactus2_zc2.zen_products_with_attributes_stock.
In fact, to test this theory, I have amended the SQL to use the table define - try this query instead
select pov.products_options_values_id,
pov.products_options_values_name,
pa.*
from " . TABLE_PRODUCTS_ATTRIBUTES . " pa join " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov
on pa.options_values_id = pov.products_options_values_id
join " . TABLE_PRODUCTS_WITH_ATTRIBUTES_STOCK . " PWAS
on PWAS.stock_attributes = pa.products_attributes_id
where pa.products_id = '" . (int)$_GET['products_id'] . "'
and pa.options_id = '" . (int)$products_options_names->fields['products_options_id'] . "'
and pa.options_values_id = pov.products_options_values_id
and pov.language_id = '" . (int)$_SESSION['languages_id'] . "'
and PWAS.quantity > 0 " .
$order_by;
Post back with your results.
Kev



