Can I print a set of data after running a query for two or more tables?
This is from two tables of my query:
1st query
$query = mysql_query("SELECT id, BuyerName,BuyerEmail,BuyerAddress,TransactionID, ItemAmount,DateTime FROM `order` WHERE YEAR(DateTime)= '$Year'AND MONTH(DateTime) = '$Month' LIMIT $start, $per_page") or die(mysql_error());2nd Query
$querydetail = mysql_query("SELECT * FROM orderlist WHERE TransactionID  = '$f4'");
And is it possible to print it the way that it's set in php by using table?
This is how I display my data in table format. Is there a way to import this output directly into Microsoft Word or something that is in A4 paper format?
 <?php  
    while($row = mysql_fetch_array($query))
    {  
              
    $f1 = $row['BuyerName'];
    $f2 = $row['BuyerEmail'];
    $f3 = $row['BuyerAddress'];
    $f4 = $row['TransactionID'];
    $f5 = $row['ItemAmount'];
    $f6 = $row['DateTime'];
 
 
  ?>
  <table class="table">
     <tr>
      <th>Nama Pelanggan</th>
      <th>Email Pelanggan</th>
      <th>Alamat Pelanggan</th>
      <th>ID Transaksi</th>
      <th>Harga</th>
      <th>Tarikh</th>
   
   <tr>
    <td><?php echo $f1 ?></td>
    <td><?php echo $f2 ?></td>
    <td><?php echo $f3 ?></td>
    <td><?php echo $f4 ?></td>
    <td><?php echo $f5 ?></td>
    <td><?php echo $f6 ?></td>
   </tr>
   <table class="table">
     <tr>
      <th>Nama Barang</th>
      <th>Kod Barang</th>
      <th>Kuantiti</th>
      
   
   
     </tr>
   <?php
 $querydetail = mysql_query("SELECT * FROM orderlist WHERE TransactionID  = '$f4'");
 while($rows = mysql_fetch_array($querydetail))
    {  
              
    $fd1 = $rows['ItemName'];
    $fd2 = $rows['ItemNumber'];
    $fd3 = $rows['ItemQTY'];
 ?>
<tr>
    <td><?php echo $fd1 ?></td>
    <td><?php echo $fd2 ?></td>
    <td><?php echo $fd3 ?></td>
</tr>