Thanks

i endend up creating a  really quick and dirty helper

 function _gettotal ($oid)
    {

$total = '';
$sql = "SELECT price,quantity FROM Orderitems where oid='$oid'";

$rst= mysql_query($sql) or die("$sql".mysql_error());

while($row = mysql_fetch_array($rst))
{

$total += $row['quantity']*$row['price'];

}

//$total = $this->Orderitems->findBySql("SELECT SUM(price) as total
FROM Orderitems where oid='$oid' ");

return $total;

}

Can someone help me tidy it up with cakephp style coding please.
that uncommented line does not work.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to