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...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...