I'm getting an unexpected parse error on a script, I have looked at it for about an hour and can't see anything untoward.
Can anyone help me out?
The error is:
Parse error: parse error, unexpected ',' in /home/uniquecraft/public_html/emailtotal.php on line 49
Line 49 relates to the last line of the code, I'm really stumped. 😕
function emailtotal($cartid,$sess){
$query="SELECT product.category,product.make,product.price,orders.ID,orders.quantity FROM product,orders WHERE orders.cartID=$cartid AND orders.prodID=product.ID";
$result=mysql_query($query);
$row=mysql_fetch_array($result);
$goodstotal=0;
$category = $row["category"];
$make = $row["make"];
$price = $row["price"];
$quantity = $row["quantity"];
do
{
$carttotal=$carttotal+($row["price"]*$row["quantity"]);
}
while ($row=mysql_fetch_array($result));
//calculate shipping html
$query="SELECT shipping.ID,shipping.description,shipping.price FROM shipping,carts WHERE carts.shippingID=shipping.ID AND carts.ID=$cartid";
$result=mysql_query($query);
$row=mysql_fetch_array($result);
$shipping=$row["price"];
if ($carttotal>149.99) {
$shipping=0;
}
$exprice=$carttotal+$shipping;
$totalprice=$exprice;
$vat=0;
//calculate VAT
if (substr($row["description"], 0, 2)=="UK") {
$vat=$exprice*0.175;
$totalprice=$vat+$exprice;
}
$vat = number_format($vat,2,'.',',');
$totalprice = number_format($totalprice,2,'.',',');
return ($category, $make, $price, $quantity, $shipping, $exprice, $vat, $totalprice);
}