• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

rented house (WEB)

nuelma123

New Member
Joined
Jun 6, 2011
Messages
66
Reaction score
1
S5SW84n.png


I have houses in rented but don't show in web site? why?

Code:
    $housesrented = $SQL->query('SELECT COUNT(*) FROM `houses` WHERE `owner`=1;')->fetch();
 
you mean to this?

Code:
    $query = $SQL->query("SELECT * FROM `players` ORDER BY `experience` DESC")->fetch();
    $query2 = $SQL->query('SELECT `id`, `name` FROM `players` ORDER BY `id` DESC LIMIT 1;')->fetch();
    $housesfree = $SQL->query('SELECT COUNT(*) FROM `houses` WHERE `owner`=0;')->fetch();
    $housesrented = $SQL->query('SELECT COUNT(*) FROM `houses` WHERE `owner`=1;')->fetch();
    $players = $SQL->query('SELECT COUNT(*) FROM `players` WHERE `id`>0;')->fetch();
    $accounts = $SQL->query('SELECT COUNT(*) FROM `accounts` WHERE `id`>0;')->fetch();
    //$banned = $SQL->query('SELECT COUNT(*) FROM `bans` WHERE `id`>0;')->fetch();
    $guilds = $SQL->query('SELECT COUNT(*) FROM `guilds` WHERE `id`>0;')->fetch();
 
S5SW84n.png


I have houses in rented but don't show in web site? why?

Code:
    $housesrented = $SQL->query('SELECT COUNT(*) FROM `houses` WHERE `owner`=1;')->fetch();

I dunno about your website codes.. but owner=1 probably means character with id 1..
And that will display wrong, you should select houses with owner id 1 or greater, like this:
PHP:
$housesrented = $SQL->query('SELECT COUNT(*) FROM `houses` WHERE `owner`>=1;')->fetch();
 
If owner is the pid than you might as well go with what @Shawak recommended or > 0.
This is why I asked for them to post the schema but if it is embedded in the code (which is clever yet dumb) then they'll need to provide a dump of the table.

I don't care what anyone on this forum says there isn't only one way to trouble shoot an issue.
 
Back
Top Bottom