Jump to content
MakeWebGames

Recommended Posts

Posted

My estate table will not print my variable.

 

$hprice=$ir['house_qty']*($r['hPRICE']*$r['hcINC'])+$r['hPRICE'];
if($ir['willmax'] > 101)
{
print "[url='estate1.php?sellhouse']Sell Your Property[/url]

";
print "<table border=5 width=300px><tr><td width=85px>House Name</td><td width=85px>House Price</td><td width=85px>Incremental Price</td><td width=85px>Platinum Cost</td><td width=65px>Base Soldiers</td><td width=65px>Soldier Increase</td></tr></table>";

$hq=mysql_query("SELECT * FROM houses WHERE hWILL = {$ir['willmax']} ORDER BY hWILL ASC",$c);
while($r=mysql_fetch_array($hq))
{


print "<table border=5 width=300px><tr><td width=85px>
[url='estate1.php?property={$r[']{$r['hNAME']}[/url]</td><td width=85px> \$$hprice </td><td width=85px> {$r['hcINC']} </td><td width=85px> {$r['platcost']} </td><td width=65px> {$r['hWILL']}</td><td width=65px>{$r['hINC']}</td></tr></table>";
}
}

$hprice=$ir['house_qty']*($r['hPRICE']*$r['hcINC'])+$r['hPRICE']; -- prints $0

 

i have tried using the equation in the <td> but it just printed out the equation $(14*(50000*0.25)+50000) or it prints $0.

Posted

Re: [V2] Help Needed

yea i figured it out.

i had to put the variable within the {} of the while statement.

So you were right it was printing 0 because there was no variable.

Thanks

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...