Give me a hand please!!
The purpose of this code is to get the totall price, but I don't know how to multiply $orderAmount ,$menuPrice inside for loop. and I also get problem to echo the result only once.
[code=php]
for ($i=1; $i<=$numRowsMen uid;++$i){
$rowOrderInfo=m ysql_fetch_asso c($resultOrderI nfo);
$orderAmount=$r owOrderInfo['orderamount'];
$resultMenuInfo = mysql_query("SE LECT * FROM menuinfo where id=$menuId");
while ($rowsMenuInfo= mysql_fetch_ass oc($resultMenuI nfo)){
$menuPrice=$row sMenuInfo['menuprice'];
}
}[/code]
The purpose of this code is to get the totall price, but I don't know how to multiply $orderAmount ,$menuPrice inside for loop. and I also get problem to echo the result only once.
[code=php]
for ($i=1; $i<=$numRowsMen uid;++$i){
$rowOrderInfo=m ysql_fetch_asso c($resultOrderI nfo);
$orderAmount=$r owOrderInfo['orderamount'];
$resultMenuInfo = mysql_query("SE LECT * FROM menuinfo where id=$menuId");
while ($rowsMenuInfo= mysql_fetch_ass oc($resultMenuI nfo)){
$menuPrice=$row sMenuInfo['menuprice'];
}
}[/code]
Comment