TMan Posted March 5, 2009 Posted March 5, 2009 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. Quote
POG1 Posted March 5, 2009 Posted March 5, 2009 Re: [V2] Help Needed Try printing each variable from that, it may be resulting in a 0 because a variable don't exist or is NULL. Quote
TMan Posted March 6, 2009 Author Posted March 6, 2009 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 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.