我有以下查询:
$cuttinglist_products_query =
tep_db_query("select op.orders_products_id, op.orders_id, op.products_id, ".
"op.products_model, op.products_name, op.products_quantity, ".
"p.products_id from " . TABLE_ORDERS_PRODUCTS . " op " .
" left join " . TABLE_PRODUCTS . " p " .
" on (op.products_id = p.products_id) where orders_id = '" .
(int)$cuttinglist['orders_id'] . "'");
这将两个具有相同 ID 的表连接在一起。我将如何加入第三张桌子,名为:
"TABLE_ORDERS_PRODUCTS_ATTRIBUTES"
具有与以下相同的 ID:
"TABLE_ORDERS_PRODUCTS"
使用的ID是:
"orders_products_id"