Hi,
I have a leadproductdetail and leadproductquality table
They both have leadid and leadprodnumber, but differ because one has
- leadproddetailfield
- leadproddetailvalue
and the other has
- leadprodqualityfield
- leadprodqualityvalue
Im trying to join the two so I can put the 4 fields above in the same table, using the following code:
<table>
<?php
$query2 = "select *
from leadproductdetail
OUTER JOIN leadproductquality
ON leadproductquality.prodid = leadproductdetail.prodid
where
leadproductdetail.leadid = '".$row['leadid']."'
AND
leadproductdetail.leadprodnumber = '".$row['leadprodnumber']."' ";
$result2 = @mysql_query($query2, $connection) or die ("Unable to perform query<br>$query2");
while($row2= mysql_fetch_array($result2))
{ ?>
<tr>
<td><?php echo $row2['leadproductdetail.leadproddetailfield']?></td>
<td><?php echo $row2['leadproductdetail.leadproddetailvalue']?></td>
</tr>
<tr>
<td><?php echo $row2['leadproductquality.leadprodqualityfield']?></td>
<td><?php echo $row2['leadproductquality.leadprodqualityvalue']?></td>
</tr>
<?php
} ?>
</table>
I get the error that it can't perform the query, around the join area