Skip to content

Help With My Php Code.

Featured Replies

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

delete this  $respawn_time = "respawn_time" ;

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.