Jump to content
MakeWebGames

Recommended Posts

<br /><br />

<hr width='75%' />

<div style='text-align:center;'>

    <h4>Mobster of the hour</h4>

    <table width='75%' class='table' style='text-align:center;' align='center'>

        <tr>

            <th>User</th>

            <th>Kills</th>

        </tr>";

        $check = $db->query('SELECT userid, username, kills FROM users ORDER BY kills DESC LIMIT 1');

        if (!$db->num_rows($check)) {

            echo "<tr><td colspan='2'>There are no users yet!</td></tr>";

        }

        while ($user = $db->fetch_row($check)) {

            echo "

            <tr>

                <td><a href='viewuser.php?u=".$user['userid']."'>".$user['username']."</a></td>

                <td>".money_formatter($user['kills'], '')."</td>

            </tr>";

        } echo "

    </table>

</div>

<hr width='75%' /><br /><br />

 

Can someone help me with this code when I try add it in explore before <? I get a error

Link to post
Share on other sites

No ending ': in last line 

Comma and semicolon

Edit:

 

If adding before the ?>

 

<br /><br />

<hr width='75%' />

<div style='text-align:center;'>

    <h4>Mobster of the hour</h4>

    <table width='75%' class='table' style='text-align:center;' align='center'>

        <tr>

            <th>User</th>

            <th>Kills</th>

        </tr>

<?

        $check = $db->query('SELECT userid, username, kills FROM users ORDER BY kills DESC LIMIT 1');

        if (!$db->num_rows($check)) {

            echo "<tr><td colspan='2'>There are no users yet!</td></tr>";

        }

        while ($user = $db->fetch_row($check)) { 

            echo "

            <tr>

                <td><a href='viewuser.php?u=".$user['userid']."'>".$user['username']."</a></td>

                <td>".money_formatter($user['kills'], '')."</td>

            </tr>";

        } echo "

    </table>

</div>

<hr width='75%' /><br /><br />";

?>

 

Not sure if it will work since $db class is called and don't think it's loaded prior

 

  • Like 1
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

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