Menu
Forums
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Trending
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
Upgrades
Log in
Register
What's new
Search
Search
Search titles only
By:
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
Server Development
Habbo Retros
Habbo Q&A
Trying to grab from two db tables to display them with php
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="WanknessHD" data-source="post: 395437" data-attributes="member: 3511"><p>Broken page, it just doesn't load.</p><p>[doublepost=1484360836,1484333189][/doublepost]Got it to work [USER=72270]@Core[/USER] did this.</p><p>[PHP]<?php</p><p> $getstats = mysql_query("SELECT * FROM user_stats ORDER BY RoomVisits DESC LIMIT 5") or die(mysql_error());</p><p> $oe = 1;</p><p> while ($info = mysql_fetch_array($getstats))</p><p> { </p><p> $userInfo = mysql_fetch_array(mysql_query("SELECT `username`,`look` FROM users WHERE `id` = '".$info['id']."'"));</p><p> {</p><p> if ($oe == 2)</p><p> {</p><p> $oe = 1;</p><p> }</p><p> else</p><p> {</p><p> $oe = 2;</p><p> } </p><p> echo '<table width="100%" style="padding: 5px; background-color: ' . (($oe == 2) ? '#fff' : '') . ';"></p><p> <tbody></p><p> <tr></p><p> <td valign="middle" width="25"><img style="margin-top: -10px;" src="http://www.habbo.nl/habbo-imaging/avatarimage?figure=' .$userInfo['look'] . '&direction=3&headonly=1"></td></p><p> <td valign="top"></p><p> <p style="font-size: 90%;"><strong><a style="text-decoration: none" href="{url}/home/' .$userInfo['username'] . '"">' .$userInfo['username'] . '</a></strong><br></i>' . $info['RoomVisits'] . '</i></p></p><p> </td></tr></tbody></table>';</p><p> }</p><p> }</p><p> ?>[/PHP]</p><p></p><p>Only issue I have is no matter how many I want to display it only shows 5, so for the mean time I just changed them all to 5 until I can get that fixed.</p></blockquote><p></p>
[QUOTE="WanknessHD, post: 395437, member: 3511"] Broken page, it just doesn't load. [doublepost=1484360836,1484333189][/doublepost]Got it to work [USER=72270]@Core[/USER] did this. [PHP]<?php $getstats = mysql_query("SELECT * FROM user_stats ORDER BY RoomVisits DESC LIMIT 5") or die(mysql_error()); $oe = 1; while ($info = mysql_fetch_array($getstats)) { $userInfo = mysql_fetch_array(mysql_query("SELECT `username`,`look` FROM users WHERE `id` = '".$info['id']."'")); { if ($oe == 2) { $oe = 1; } else { $oe = 2; } echo '<table width="100%" style="padding: 5px; background-color: ' . (($oe == 2) ? '#fff' : '') . ';"> <tbody> <tr> <td valign="middle" width="25"><img style="margin-top: -10px;" src="http://www.habbo.nl/habbo-imaging/avatarimage?figure=' .$userInfo['look'] . '&direction=3&headonly=1"></td> <td valign="top"> <p style="font-size: 90%;"><strong><a style="text-decoration: none" href="{url}/home/' .$userInfo['username'] . '"">' .$userInfo['username'] . '</a></strong><br></i>' . $info['RoomVisits'] . '</i></p> </td></tr></tbody></table>'; } } ?>[/PHP] Only issue I have is no matter how many I want to display it only shows 5, so for the mean time I just changed them all to 5 until I can get that fixed. [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Server Development
Habbo Retros
Habbo Q&A
Trying to grab from two db tables to display them with php
Top