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

Zeros problem -will find it at last post-

Doggynub

LUA / C++
Joined
Sep 28, 2008
Messages
2,541
Reaction score
186
Sometimes when there is somthng wrong then the page dont show up at all it is blank,

So i added a custom error shower[somone from the toutorial sites]

And i go this error


Code:
Error: [8] Constant USING_WINDOWS already defined


So can someone explain me the type of error[ why is it shown and when it is shown] ??
 
Show lines 7 - 9. (I think that error code tells us that the error is located at line 8). I assume the error is not so obvious as the error says, that you declared using windows twice or something.)

Mind as well just show the whole script, your gonna release it right? :p

Perhaps you declared something that Modern AAC already uses?
 
Hmm, ye it was somthng else and managed to fix it, that [8] was the error level as i am usinga custom error_function :)
 
It's nothing with it. It's just warning, that we are trying to define the same constant twice, anyway Modern has built in debugger
 
Another thing :
PHP:
foreach($SQL->query('SELECT `name`,`goals`,`total`,`wins` FROM `players` ORDER BY ((`wins`/`total`)*`goals`)+`wins` DESC LIMIT 15') as $result)
{  
$i++;
if ($result['total'] >= $min){
echo'<tr class="highlight"><td style="text-align: left;">' . $i . '</td>
        <td><a href="'.WEBSITE.'/index.php/character/view/'.$result['name'].'">'.$result['name'].'</a></td>
        <td style="text-align: center;">' .  ceil($result['wins']/$result['total'] * 100)  . '%</td><td style="text-align: center;">' . $result['goals'] . '</td><td style="text-align: center;">'. abs($result['total']) .'</td><td style="text-align: center;">' .$result['wins'] . '</td></tr>'; }}}

I have this as a highscore table that i have been making and i am suffering from weird "0"s


37329131.png



Edit : i am sure it is somthng with the loop, as on decraseing the limit of fetching data from db to 3, the 0 before "Made by" disappear.
 
Last edited:
like that ?
Code:
$SQL->query('SELECT `name`,ROUND(goals,0) as goals,ROUND(total,0) as total ,ROUND(wins,0) as wins FROM `players` LIMIT 15'
 
Ok now i know where is the error if the db valuse return "0" this thing happens lol..
 
Back
Top