Probably a bit of a simple one this time 😉
Displaying info from two tables it will work but it will not show the first record in the database table.
Any ideas?
Select code:
$query_find_WO = "SELECT ProductID, Amount FROM WarrantPOrder WHERE WRef='$ref'";
$findWO = mysql_query($query_find_WO, $localhost) or die(mysql_error());
$row_WO = mysql_fetch_array($findWO);
Display code:
<?php
if ((isset($row_WO['WRef'])) == '$ref') {
print '<span class="red"><div align="center">No parts added to claim</div></span>';
}
else {
while ($row = mysql_fetch_array($findWO)){
print ' <tr>'."\n\n".
' <td width="30" bgcolor="#F2F2F2"><a href="dwcp.php?action=remove_item&id=' . $row["ProductID"] . '">Remove</a></td>'."\n\n".
' <td width="100" bgcolor="#F2F2F2">' . $row['ProductID'] . '</td>';
$pnum = $row['ProductID'];
$query_part_details = "SELECT Partnumber, Description, Price FROM products WHERE Partnumber='$pnum'";
$part_details = mysql_query($query_part_details, $localhost) or die(mysql_error());
while ($row2 = mysql_fetch_array($part_details)){
print
' <td width="300" bgcolor="#F2F2F2">' . $row2['Description'] . '</td>'."\n\n".
' <td width="20" bgcolor="#F2F2F2">$' . $row2['Price'] . '</td>'."\n\n".
' <td width="20" bgcolor="#F2F2F2"><input name="amount[' . $row2['Partnumber'] . ']" type="text" size="6" value="' . $row['Amount'] . '"/></td>'."\n\n".
' <td width="20" bgcolor="#F2F2F2">$ </td>'."\n\n".
' </tr>';
}
}
}
?>
Any help is a good thing.