Zuben45 Posted January 25, 2009 Posted January 25, 2009 Hello , I have estate.php : <?php include "globals.php"; $mpq=$db->query("SELECT * FROM houses WHERE hWILL={$ir['maxwill']}"); $mp=$db->fetch_row($mpq); $_GET['property']=abs((int) $_GET['property']); if($_GET['property']) { $npq=$db->query("SELECT * FROM houses WHERE hID={$_GET['property']}"); $np=$db->fetch_row($npq); if($np['hWILL'] < $mp['hWILL']) { print "You cannot go backwards in houses!"; } else if ($np['hPRICE'] > $ir['money']) { print "You do not have enough money to buy the {$np['hrNAME']}."; } else { $db->query("UPDATE users SET money=money-{$np['hPRICE']},will=0,maxwill={$np['hWILL']} WHERE userid=$userid"); print "Congrats, you bought the {$np['hNAME']} for \${$np['hPRICE']}!"; } } else if (isset($_GET['sellhouse'])) { $npq=$db->query("SELECT * FROM houses WHERE hWILL={$ir['maxwill']}"); $np=$db->fetch_row($npq); if($ir['maxwill'] == 100) { print "You already live in the lowest property!"; } else { $db->query("UPDATE users SET money=money+{$np['hPRICE']},will=0,maxwill=100 WHERE userid=$userid"); print "You sold your {$np['hNAME']} and went back to your shed."; } } else { print "Your current property: [b]{$mp['hNAME']}[/b] The houses you can buy are listed below. Click a house to buy it. "; if($ir['maxwill'] > 100) { print "[url='estate.php?sellhouse']Sell Your House[/url] "; } $hq=$db->query("SELECT * FROM houses WHERE hWILL>{$ir['maxwill']} ORDER BY hWILL ASC"); while($r=$db->fetch_row($hq)) { print "[url='estate.php?property={$r[']{$r['hNAME']}[/url]   - Cost: \${$r['hPRICE']}   - Will Bar: {$r['hWILL']} "; } } $h->endpage(); ?> And , I only see : Your current property: Divo?ina The houses you can buy are listed below. Click a house to buy it. Sell Your House but , I not see houses for buy :( , help me please , Thanks Quote
CLANG Posted January 25, 2009 Posted January 25, 2009 Re: I need help with estate.php dont know about the code but are you sure you're not living in the highest worth property. If you are then it woudnt show any Quote
Zuben45 Posted January 25, 2009 Author Posted January 25, 2009 Re: I need help with estate.php yes , I do . when i click on Sell your house , that it write : You already live in the lowest property! :( EDIT : Quote
AlabamaHit Posted January 25, 2009 Posted January 25, 2009 Re: I need help with estate.php check the house you made in the database. Make sure you didnt make a typo and make the will very high by adding a 0 at the end or something. Quote
Zuben45 Posted January 25, 2009 Author Posted January 25, 2009 Re: I need help with estate.php Yes , I have it in database , and here is screen : Quote
AlabamaHit Posted January 25, 2009 Posted January 25, 2009 Re: I need help with estate.php There is nothing wrong. The page is right. It orders the houses by WILL.. You have the first house at 100. So the page thinks you have the Best house. Because all th other houses are Lower in Will. You need to edit the the other houses. The will has to Increase iwth the houses. Quote
Zuben45 Posted January 25, 2009 Author Posted January 25, 2009 Re: I need help with estate.php I edit first house in database on hWILL on 1 , but any change , can you send me your databse houses ? thanks EDIT : I delete database houses , and I insert new table houses , and now is it funstion :) , thbnkas Quote
AlabamaHit Posted January 25, 2009 Posted January 25, 2009 Re: I need help with estate.php Cool, just keep in mind..the bigger the house the bigger the will needs to be.. If you do not increase the will it will not show the houses. Because the page only shows houses with Will higher than yours. 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.