Jump to content

Question

Posted

Hello guys so i have this code in my website

 

function connect() 
{ 
include "configs/script_config.php";
}

$sexes = array('Male', 'Famale'); 
$online = array('0' => "<font color=#FF0000><b>OFFLINE</b></font>", '1' => "<font color=#035922><b>ONLINE</b></font>");
$klan = array('0' => "No Clan"); 

$FORM = "" ; 
$query_chars = "select char_name,level,sex,clanid,onlinetime,lastAccess from characters where onlinetime >= 1 order by onlinetime desc limit 50;"; 
connect(); 
$link = mysql_query($query_chars); 
$i=1; 
$r=255; 
while ( $row=mysql_fetch_row($link) )
{  
    $timer=$row[4];
    $day = bcdiv($row[4],86400);
    $datetime  = gmstrftime("$day day(s) %H hour(s) %M min(s)", $timer);
    $timer2=$row[5]/1000;
    $datetime2  = gmstrftime("%d.%m.%Y", $timer2);
    $datetime3  = gmstrftime("%H:%M:%S GMT", $timer2);
    $query = "select clan_name from clan_data where clan_id=$row[3]"; 
    $link2 = mysql_query($query); 
    $clan = mysql_fetch_row($link2);  

    $FORM .= "<table border='3'> <tr>    
    <td align=center><font color=#808080><b>  $i.</b></span></td> 
    <td align=center><font color=#AE5C08>  $row[0]</td>
    <td class='Stil5' align=center>$row[1]</td>  
    <td class='Stil5' align=center>".$sexes[$row[2]]."</td>  
    <td align=center><font color=#21ff22>[".$clan[0]."]</td> 
    <td align=center><font color=#21ff22>$datetime</td>
    </tr></table>"; 
    $i++; 
    $r -= 0; 
}  

mysql_close(); 

echo $FORM; 

 

The code is ok but i want to see the list in Columns like: Name/Class/Clan/OnlineTime and to be fixed because if someone has a bigger name the table is bigger... any ideas?

2 answers to this question

Recommended Posts

Guest
This topic is now closed to further replies.


×
×
  • Create New...