• 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!

[SQL] Gesior - PowerGamers

subyth

New Member
Joined
May 1, 2009
Messages
56
Reaction score
4
I tried everything.
When the subtract of SQL is negative, an abnormal value is returned.

SQL:
db.executeQuery("UPDATE `players` SET `exphist7`=`exphist6`, `exphist6`=`exphist5`, `exphist5`=`exphist4`, `exphist4`=`exphist3`, `exphist3`=`exphist2`, `exphist2`=`exphist1`, `exphist1`=`experience`-`exphist_lastexp`, `exphist_lastexp`=`experience`;")

If you subtract 4870-10000, it returns +9.223.372.036.854.775.808 in website
I'm using Xampp 1.7.3 on windows, does it hurt?

I also added a type of RANK, with ORDER BY but it always returns the negative number as the first.
SQL:
$SQL->query("SELECT `name`, `looktype`, `lookaddons`, `lookhead`, `lookbody`, `looklegs`, `lookfeet`, `level`, `vocation`, `experience`, `exphist_lastexp` FROM `players` WHERE `deleted` = 0 AND (`account_id` != 1 AND `group_id` < 4) ORDER BY `experience`-`exphist_lastexp` DESC LIMIT 5")->fetchAll();
 
I tried everything.
When the subtract of SQL is negative, an abnormal value is returned.

SQL:
db.executeQuery("UPDATE `players` SET `exphist7`=`exphist6`, `exphist6`=`exphist5`, `exphist5`=`exphist4`, `exphist4`=`exphist3`, `exphist3`=`exphist2`, `exphist2`=`exphist1`, `exphist1`=`experience`-`exphist_lastexp`, `exphist_lastexp`=`experience`;")

If you subtract 4870-10000, it returns +9.223.372.036.854.775.808 in website
I'm using Xampp 1.7.3 on windows, does it hurt?

I also added a type of RANK, with ORDER BY but it always returns the negative number as the first.
SQL:
$SQL->query("SELECT `name`, `looktype`, `lookaddons`, `lookhead`, `lookbody`, `looklegs`, `lookfeet`, `level`, `vocation`, `experience`, `exphist_lastexp` FROM `players` WHERE `deleted` = 0 AND (`account_id` != 1 AND `group_id` < 4) ORDER BY `experience`-`exphist_lastexp` DESC LIMIT 5")->fetchAll();
Consider you make the output of your numbers a float.
To find more information about using floats in php, check here: php.net - floatval
 
Back
Top