SELECT heading_title, opening_day, opening_time FROM heading_openinghour CROSS JOIN timetble
WHERE heading_openinghour.heading_id=timetble.heading_id;
while ($row=mysql_fetch_array($result))
{
$heading;
if($heading!=$row['0'])
{
echo $row['0'];
$heading=$row['0'];
}
echo $row['1'];
echo $row['2'];
}
I am using cross join query to select heading from first table
and sub headings from second table.The query works fine but I want to run
query in a way that when query finish printing one heading and all
of its sub heading then it print an extra text field under that sub headings and
then next line starts.
any idea how to do this.
Example
heading1
sub heading1
sub heading2
sub heading3
insert text field here
heading2
sub heading1
sub heading2
sub heading3
sub heading4
sub heading5
insert text field here
heading2
sub heading1
insert text field here