adssss

Saturday, February 1, 2014

Quick bit of PHP help :)

Web VPS

hey there, im working on a little project at the moment to create some reports a bit easier... but im a bit stuck currently.... wondering if someone could give some ideas..


so far i have this.. but it still doesn't work quite well for me.. i am trying to make a table of asset classes and how much people have within the assets.. but only trying to make it appear ONCE in the while loop.




$class = mysql_query("SELECT DISTINCT assetclass FROM asset WHERE clientid = '$cid'");
while($cres = mysql_fetch_object($class)){
foreach($cres as $aclass){

...... *Random bits and pieces that have no affect here.....

$q2 = mysql_query("SELECT * FROM asset WHERE clientid = '$cid' AND assetclass = '$cres->assetclass'");
while($s = mysql_fetch_object($q2))
{
$i = 0;
if($cres->assetclass == 'asx'){
$price = mysql_query("SELECT * FROM asxcode WHERE code = '$s->assetname'");
$c = mysql_fetch_array($price);
$tot = $c['price']*$s->assetamount;
$asxprice += $tot;
$total = $asxprice;
if(!empty($asxprice)){
$result .= " $tablename ";
$result .= " $c[name] ($s->assetname)";

$result .= "$tot";
}
if($i == 0)
$result .= "*percent Function* %";
}
$i++;



currently it appears as this


image


anyone got some ideas for me?





LowEndTalk http://ift.tt/1nCn57I Quick bit of PHP help :) Web vps hosting server Linux - Windows webvps.blogspot.com

0 comments:

Post a Comment

 

© Copyright Alam Perwira