[HELP] How To Get Something From A Database And Display It

Status
Not open for further replies.

Twisting

HFFM
Sep 4, 2011
362
79
If you know me, Im very curious with alot of things and a thing that came into my mind is:

On A Habbo Retro, How are you able to get the users looks and display it on the page?
I Think it has got to do with MySQL like maybe:

mysql_get_users:looks

I dont know what the real code is but, Help? :)

Sorry If in wrong section,
 

Xenous

o shi
Nov 15, 2011
383
101
Just a rough thing I did not completely sure if it will work but it should after you edit it to your needs ect.
PHP:
$query = mysql_query('SELECT null FROM `users` WHERE `username` = $username;')
  $fetch = mysql_fetch_array($query);
echo '<img src="http://www.habbo.com/habbo-imaging/avatarimage?figure=' . $fetch['figure'] .'"/>';
 

Twisting

HFFM
Sep 4, 2011
362
79
Tried your link above and it didnt work, so I tried using this from my /me page on RevCMS

PHP:
<img src="http://www.habbo.com/habbo-imaging/avatarimage?figure={figure}
&action=wav&direction=2&head_direction=3&gesture=srp&size=l" id="user"/>

Could That Work In Like A Normal Disconnection Page For Example, Or Will You Need To Add Something :L
 

Xenous

o shi
Nov 15, 2011
383
101
It would need some editing as I wasnt coding it for a database to be exact, nor have i tested it but it should work, oops if your using revcms that would work
 

Xenous

o shi
Nov 15, 2011
383
101
Sorry I was afk :D

PHP:
<?php
$asf = 'database_name';
$abc = mysql_connect('localhost', 'root', 'password');
mysql_select_db($asf, $abc);
$query = mysql_query("SELECT *FROM `users` WHERE `username` ='$variable giving username'");
  $fetch = mysql_fetch_array($query);
echo '<img src="http://www.habbo.com/habbo-imaging/avatarimage?figure=' . $fetch['look'] .'"/>';
?>

Updated and working
 

Gajeel

Well-Known Member
Oct 4, 2011
2,411
413
do i change 'null' from your code to my database name :S
For RevCMS (you're currently using) it can be like this
Code:
<img src="http://www.habbo.com/habbo-imaging/avatarimage?figure={figure}>
E.g. the value for {figure} is or the player's figure is
ea-3168-62.ch-3185-102.lg-275-110.hr-3163-39.fa-1201-100.hd-185-8.cp-3205-62
Then when it's translated to HTML it will be
<img src=" ea-3168-62.ch-3185-102.lg-275-110.hr-3163-39.fa-1201-100.hd-185-8.cp-3205-62>
Which will appear like this
avatarimage
 

Livar

Now 35% cooler!
Oct 15, 2010
846
86
PHP:
$username = $_SESSION['UBER_USER_N'];
$q = mysql_query("SELECT * FROM users WHERE username = '$username'");
$a = mysql_fetch_assoc($q);
 
echo $a['look'];

sure that would work.
 
Status
Not open for further replies.

Users who are viewing this thread

Top