Online Time

May 1, 2015
468
153
Hello,
I am trying to create "Online Time" for the top stats page, I'm almost there i am just trying to add a <br> to seperate the user and it just doesn't want to work. I've tried honestly everything it just adds on the bottom or the top.
Here is what it looks like, and what i want it to look like. (I want those lines on the left image to be on the right, seperating each user)
h8zEfIz.png


Here is my code,
Code:
<div id="column" class="column" style="width:192px;">
<div class="habblet-container ">
<div class="cbb clearfix white ">  
<center><h2 class="title">Online Time</h2></center>
<div align='left'> 

<table width="100%">
<tr>

                        <?php
                        $getOnline = mysql_query("SELECT `id`,`OnlineTime` FROM `user_stats` ORDER BY `OnlineTime` DESC LIMIT 5") or die(mysql_error());
                        while($onlineInfo = mysql_fetch_array($getOnline))
                        {
                            $days = floor($onlineInfo['OnlineTime'] / (60*60*24));
                            $userInfo = mysql_fetch_array(mysql_query("SELECT `username`,`look` FROM users WHERE `id` = '".$onlineInfo['id']."'"));

                            echo '
                            <tr>
                                <td width="25%"><img src="http://www.habbo.nl/habbo-imaging/avatarimage?figure=' . $userInfo['look'] . '&head_direction=2&gesture=sml&headonly=1" align="left"></td>
                                <td width="75%"><a href="{url}/home/'.$userInfo['username'].'"<b>'.$userInfo['username'].'</b></a><br />Spent <b>'. $days . '</b> day(s) online</td>
                               
                            </tr>';
                           
                        }      
                        ?>
                       
                        </table>
                       
                    </div>
                </div>
            </div>
        </div>
I am new to this, so thanks a ton.
 

JayC

Always Learning
Aug 8, 2013
5,497
1,398
Code:
<div id="column" class="column" style="width:192px;">
<div class="habblet-container ">
<div class="cbb clearfix white "> 
<center><h2 class="title">Online Time</h2></center>
<div align='left'>

<table width="100%">
<tr>

                        <?php
                        $getOnline = mysql_query("SELECT `id`,`OnlineTime` FROM `user_stats` ORDER BY `OnlineTime` DESC LIMIT 5") or die(mysql_error());
                        while($onlineInfo = mysql_fetch_array($getOnline))
                        {
                            $days = floor($onlineInfo['OnlineTime'] / (60*60*24));
                            $userInfo = mysql_fetch_array(mysql_query("SELECT `username`,`look` FROM users WHERE `id` = '".$onlineInfo['id']."'"));

                            echo '
                            <tr style="border-bottom: 3px solid grey;">
                                <td width="25%"><img src="http://www.habbo.nl/habbo-imaging/avatarimage?figure=' . $userInfo['look'] . '&head_direction=2&gesture=sml&headonly=1" align="left"></td>
                                <td width="75%"><a href="{url}/home/'.$userInfo['username'].'"<b>'.$userInfo['username'].'</b></a><br />Spent <b>'. $days . '</b> day(s) online</td>
                               
                            </tr>';
                           
                        }     
                        ?>
                       
                        </table>
                       
                    </div>
                </div>
            </div>
        </div>
 

Berk

berkibap#4233
Developer
Oct 17, 2015
863
190
HTML:
<div id="column" class="column" style="width:192px;">
<div class="habblet-container ">
<div class="cbb clearfix white ">
<center><h2 class="title">Online Time</h2></center>
<div align='left'>

<table width="100%">
<tr>

                        <?php
                        $getOnline = mysql_query("SELECT `id`,`OnlineTime` FROM `user_stats` ORDER BY `OnlineTime` DESC LIMIT 5") or die(mysql_error());
                        while($onlineInfo = mysql_fetch_array($getOnline))
                        {
                            $days = floor($onlineInfo['OnlineTime'] / (60*60*24));
                            $userInfo = mysql_fetch_array(mysql_query("SELECT `username`,`look` FROM users WHERE `id` = '".$onlineInfo['id']."'"));

                            echo '
                            <tr style="border-bottom: 3px solid grey;">
                                <td width="25%"><img src="http://www.habbo.nl/habbo-imaging/avatarimage?figure=' . $userInfo['look'] . '&head_direction=2&gesture=sml&headonly=1" align="left"></td>
                                <td width="75%"><a href="{url}/home/'.$userInfo['username'].'"<b>'.$userInfo['username'].'</b></a><br />Spent <b>'. $days . '</b> day(s) online</td><hr>
                             
                            </tr>';
                         
                        }   
                        ?>
                     
                        </table>
                     
                    </div>
                </div>
            </div>
        </div
Try this
 

Berk

berkibap#4233
Developer
Oct 17, 2015
863
190
HTML:
<div id="column" class="column" style="width:192px;">
<div class="habblet-container ">
<div class="cbb clearfix white ">
<center><h2 class="title">Online Time</h2></center>
<div align='left'>

<table width="100%">
<tr>

                        <?php
                        $getOnline = mysql_query("SELECT `id`,`OnlineTime` FROM `user_stats` ORDER BY `OnlineTime` DESC LIMIT 5") or die(mysql_error());
                        while($onlineInfo = mysql_fetch_array($getOnline))
                        {
                            $days = floor($onlineInfo['OnlineTime'] / (60*60*24));
                            $userInfo = mysql_fetch_array(mysql_query("SELECT `username`,`look` FROM users WHERE `id` = '".$onlineInfo['id']."'"));

                            echo '
                            <tr style="border-bottom: 3px solid grey;">
                                <td width="25%"><img src="http://www.habbo.nl/habbo-imaging/avatarimage?figure=' . $userInfo['look'] . '&head_direction=2&gesture=sml&headonly=1" align="left"></td>
                                <td width="75%"><a href="{url}/home/'.$userInfo['username'].'"<b>'.$userInfo['username'].'</b></a><br />Spent <b>'. $days . '</b> day(s) online</td><hr>
                            
                            </tr>';
                        
                        }  
                        ?>
                    
                        </table>
                    
                    </div>
                </div>
            </div>
        </div
Try this
 

Users who are viewing this thread

Top