WanknessHD
Hardcore Habboer
- Jun 13, 2011
- 48
- 5
I have a stats page that displays credits/duckets/diamonds/room visits/repects given/recieved/online time etc.. only problem I have is I'm not very educated with php and I dont know how to grab from two tables in my database. I have my credits and duckets and diamonds displayed perfectly, but the rest of them display the amount but not the user associated with them.
The code to display my credits etc:
And the code I was using to grab the others (same code just tweaked to show what I have)
If anyone is willing to guide me on how to fix this im more than down, not looking for handouts as I would like to know how to fix something like this in the future, so if someone could maybe explain and help thatd be cool. Thanks for your time in advance.
Edit: Im able to call the first three because theyre in the users table associated with the character, for the rest im trying to grab the character so it can be displayed like the others.
The code to display my credits etc:
PHP:
<?php
$getstats = mysql_query("SELECT * FROM users ORDER BY vip_points DESC LIMIT 6");
$oe = 1;
while ($info = mysql_fetch_array($getstats))
{
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=' .$info['look'] . '&direction=3&headonly=1"></td>
<td valign="top">
<p style="font-size: 90%;"><strong><a ' .$info['username'] . '">' .$info['username'] . '</a></strong><br></i>' . $info['vip_points'] . '</i></p>
</td></tr></tbody></table>';
}
?>
And the code I was using to grab the others (same code just tweaked to show what I have)
PHP:
<?php
$getstats = mysql_query("SELECT * FROM user_stats ORDER BY RoomVisits DESC LIMIT 6");
$oe = 1;
while ($info = mysql_fetch_array($getstats))
{
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=' .$info['look'] . '&direction=3&headonly=1"></td>
<td valign="top">
<p style="font-size: 90%;"><strong><a ' .$info['username'] . '">' .$info['username'] . '</a></strong><br></i>' . $info['RoomVisits'] . '</i></p>
</td></tr></tbody></table>';
}
?>
If anyone is willing to guide me on how to fix this im more than down, not looking for handouts as I would like to know how to fix something like this in the future, so if someone could maybe explain and help thatd be cool. Thanks for your time in advance.
Edit: Im able to call the first three because theyre in the users table associated with the character, for the rest im trying to grab the character so it can be displayed like the others.