Jump to content

Recommended Posts

Posted

i have a problem with my php that say raidboss respawn time.

have a look on the code.

    Raid Boss Information<br><br>
    <table>

<tr><td>Name</td><td>Status</td><td>Spawn</td></tr>
<?php
$hostname = "-----"; // server ip
$database = -----"; // mysql database
$user = "-----"; // mysql username
$pass = "-------"; // mysql password

$connect = @mysql_connect($hostname, $user, $pass);
@mysql_select_db($database, $connect);



if(!$connect)
echo 'Can\'t connect to the database';
else
{
$raidspawn = mysql_query("SELECT boss_id,respawn_time FROM raidboss_spawnlist ORDER BY respawn_time DESC");
while(list($boss_id,$respawn_time) = mysql_fetch_row($raidspawn))
    $limite = 26 ;

{
    $raidnames = mysql_query("SELECT name FROM raidboss_spawnlist ORDER BY respawn_time  DESC LIMIT 0, ".$limite."");
    $text = '<font color="00FF00">Alive</font>';
    $respawn = '<font color="0000FF">Spawn</font>';
    $respawn_time = "respawn_time" ;
    
    if($respawn_time > 0)
    {
        $respawntime = date('r',($respawn_time / 1000));
        $text = '<font color="FF0000">Dead</font>';
        $respawn = '<font color="FF0000">Respawn in '.$respawntime.'</font>';
    }

    while(list($raidname) = mysql_fetch_row($raidnames))
    {
        echo '<tr><td>'.$raidname.'</td><td>'.$text.'</td><td>'.$respawn.'</td></tr>';
    }
}
}
?>
</table>

 

 

This if is not working (when raid is down it doesnt do nothing)

 
    if($respawn_time > 0)
    {
        $respawntime = date('r',($respawn_time / 1000));
        $text = '<font color="FF0000">Dead</font>';
        $respawn = '<font color="FF0000">Respawn in '.$respawntime.'</font>';
    }

    while(list($raidname) = mysql_fetch_row($raidnames))
    {
        echo '<tr><td>'.$raidname.'</td><td>'.$text.'</td><td>'.$respawn.'</td></tr>';
    }
}
}
?>

 

  • 2 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..