<?php
//New Join Query

$sql = "SELECT `Load Data`.`Load No`,
				`Load Data`.`Crop Day`,
				`Load Data`.`Tract No`,
				`Load Data`.`Gross Wt`,
				`Load Data`.`In Tare`,
				`Load Data`.Tons,
				`Load Data`.`In Time`,
				`Load Data`.`Out Time`,
				INSCALE.Hauler
		FROM `Load Data` RIGHT JOIN INSCALE ON `Load Data`.`Load No` = INSCALE.Load ORDER BY `Crop Day` DESC,`In Time` DESC"; 
				
{
	 echo "<tr>";
	     echo "<td>".$row [ 'load' ]."</td>";
		 echo "<td>".$row [ 'cropday' ]."</td>";
		 echo "<td>".$row [ 'tractno' ]."</td>";
		 echo "<td>".$row [ 'gross' ]." </td>";
		 echo "<td>".$row [ 'intare' ]." </td>";
		 echo "<td>".$row [ 'tons' ]." Tons</td>";
		 echo "<td>".$row [ 'intime' ]." </td>";
		 echo "<td>".$row [ 'outtime' ]." </td>";
	 echo "</tr>";
 }
				

//Original Query

$sql = "SELECT * FROM `Load Data` ORDER BY `Crop Day` DESC,`In Time` DESC"; 


{
	 echo "<tr>";
	     echo "<td>".$row [ 'Load No' ]."</td>";
		 echo "<td>".$row [ 'Crop Day' ]."</td>";
		 echo "<td>".$row [ 'Tract No' ]."</td>";
		 echo "<td>".$row [ 'Gross Wt' ]." </td>";
		 echo "<td>".$row [ 'In Tare' ]." </td>";
		 echo "<td>".$row [ 'Tons' ]." Tons</td>";
		 echo "<td>".$row [ 'In Time' ]." </td>";
		 echo "<td>".$row [ 'Out Time' ]." </td>";
	 echo "</tr>";
 }
 
 