douglaswalker Posted July 16, 2022 Share Posted July 16, 2022 Hi there I am trying to access 3 tables in Oscommerce Database to pull some orders showing products and attributes but cant get it to work. Just says I have an error in my SQL I am selecting from orders and orders_products and orders_products_attributes linked by orders_id... This is the original $products_query = tep_db_query("SELECT op.products_model, op.orders_id, op.products_quantity FROM orders_products op LEFT JOIN orders o ON op.orders_id = o.orders_id where op.orders_id IN (" . $orders_implode . ") and op.clubosc_shipping_type != 'dropshipped' ORDER BY op.orders_id DESC, op.products_id DESC"); This is what I have attempted $products_query = tep_db_query("SELECT op.products_model, op.orders_id, op.products_quantity, opa.orders_id, opa.products_options_values, FROM orders_products op, orders_products_attributes opa LEFT JOIN orders o ON op.orders_id = o.o orders_id JOIN orders_products op ON opa.orders_id = op.op orders_id where opa.orders_id IN (" . $orders_implode . ") and op.clubosc_shipping_type != 'dropshipped' ORDER BY op.orders_id DESC, op.products_id DESC"); Link to comment Share on other sites More sharing options...
241 Posted July 18, 2022 Share Posted July 18, 2022 On 7/16/2022 at 8:22 AM, douglaswalker said: op.orders_id = o.o orders_id No longer giving free advice. Please place deposit in meter slot provided. Individual: [=] SME: [==] Corporation: [===] If deposit does not fit one of the slots provided then you are asking too much! Is your Osc dated try Phoenix raising oscommerce from the ashes. Link to comment Share on other sites More sharing options...
YePix Posted July 19, 2022 Share Posted July 19, 2022 $products_query = tep_db_query("SELECT op.products_model, op.orders_id, op.products_quantity, opa.orders_id, opa.products_options_values FROM Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.