<?php
$sql_twin_product="select * from twin_product as twin
left join product as product_one on twin.product_1 = product_one.product_id
left join product as product_two on twin.product_1 = product_two.product_id";
$result_twin_product=mysql_query($sql_twin_product)or die(mysql_error());
$row_twin_product=mysql_fetch_array($result_twin_product);
?>
ใช้ as เพื่อลดความยาว ไม่ใช่เพิ่มความยาวครับ
แก้เป็น Code (PHP)
<?php
$sql_twin_product="
select tw.*, p1.name, p1.price, p2.name, p2.price
from twin_product as tw
left join product as p1 on tw.product_1 = p1.product_id
left join product as p2 on tw.product_2 = p2.product_id";
$result_twin_product=mysql_query($sql_twin_product) or die($sql_twin_product . "<br>" . mysql_error());
$row_twin_product=mysql_fetch_assoc($result_twin_product);
print_r($row_twin_product);
?>