I have 2 table.
Table1 "Order"
orderid - customer_id
1001 - 1234
Table2 "Items"
no - orderid - items_code
1 - 1001 - 100
2 - 1001 - 200
3 - 1001 - 300
how to get results as below (in php):
Order # Items Customer ID
_________________________________________
1001 100, 200, 300 1234
_________________________________________
1002 400, 500, 600 1210
_________________________________________
1003 321, 654, 987 1256
_________________________________________
This is my previous coding:
<?
include("cat-config.php");
$resultdata=mysql_query("
(SELECT * FROM Order LIMIT 10)
");
echo "<table width=\"100%\" border=\"0\">
<tr>
<td>Order #</td>
<td>Items</td>
<td>Customer ID</td>
</tr>";
while($row=mysql_fetch_assoc($resultdata)){
echo "
<tr>
<td>$row[OrderID]</td>
<td>
**(I want loops items data on table "items": 100, 200,300 here)
</td>
<td>$row[CustomerID</td>
</tr>
";
}
mysql_close();
?>