I have a query in which two columns include Unit Cost and Unit Price. I'd like to add the values in these columns.
I've checked several other threads which discuss this topic, but I'm still unclear on how to go about this.
Here's the query:
$query1 = "SELECT * FROM Products,Inventory_transactions,Show_info_access, Sales_consultants WHERE
Products.ProductID = Inventory_transactions.ProductID AND
Inventory_transactions.ConsultantID = Sales_consultants.ConsultantID AND
Inventory_transactions.ShowID = Show_info_access.ShowID AND
Show_info_access.Hostess = '$_POST[Hostess]'
ORDER BY Products.SKU";
$result = mysql_query($query1) or die ("Couldn't execute query");
echo "<table cellspacing='0' cellpadding = '5' border = '1'>";
echo "<th>SKU</th>";
echo "<th>Description</th>";
echo "<th>Qty</th>";
echo "<th>Unit Cost</th>";
echo "<th>Unit Price</th>";
echo "<th>Hostess</th>";
echo "<th>Consultant</th>";
while ($row = mysql_fetch_array($result))
{
extract($row);
echo "<tr>\n
<td>$SKU</td>\n
<td>$Description</td>\n
<td>$Qty_sold</td>\n
<td>$Unit_Cost</td>\n
<td>$Unit_Price</td>\n
<td>$Hostess</td>\n
<td>$Consultant</td>\n
</tr>\n";
}
echo "</table>\n";