hi ,, need help with looping LEFT JOIN
its a boat trip price list
need to show prices for each month
i have 2 mysql tables
1. months (month_id, month_order, month_name)
2. prices (prices_id, month_id, prices_order, date_from, date_to, boat, prices_amount)
i have got help to write the code to join and fetch data from those tables
<?
$query_recBookingList = "SELECT month_name, date_from, date_to, boat, prices_amount
FROM
months m
LEFT JOIN prices p
ON p.month_id = m.month_id
ORDER BY month_order, price_order";
$recBookingList = mysql_query($query_recBookingList, $mermaid) or die(mysql_error());
$row_recBookingList = mysql_fetch_assoc($recBookingList);
$totalRows_recBookingList = mysql_num_rows($recBookingList);
mysql_free_result($recBookingList);
?>
now i got html results shows the first month and the first price for this month as show below
Februar 2012
09.02.12 | 16.02.12 | My Mermaid | HRG | Brothers | |
now i need to get the other months and tours prices for each month to display like example
February 2012
Date From | Date To | Boat | Price
09.02.12 | 16.02.12 | Sea Star| 500
16.02.12 | 23.02.12 | Sea Star | 4480
23.02.12 | 01.03.12 | Sea Star | 560
March 2012
02.03.12 | 09.03.12 | Sea Star | 500
09.03.12 | 16.03.12 | Sea Star | 500
16.03.12 | 23.03.12 | Sea Star | 4480
23.03.12 | 30.03.12 | Sea Star | 560
etc..
so if someone know how to create the while loop ,,, thanks