Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

I Need Show The Last Register User In PHP

Banned
Banned
Joined
Sep 17, 2011
Messages
71
Reaction score
1
I Need Show The Last Register User In menu.tpl

I Need Show The Last Register User In PHP, i have this table called " users " and have this rows "id" and " username " , but i want show in the menu.tpl the last registered user i have this code for the total of users:

<p><a><b><font color='red'>Total User: <?php $users = mysql_num_rows(mysql_query("SELECT SQL_CACHE * FROM ".TB_PREFIX."users")); echo $users; ?></font></b></a></p>

Please Dzoki help me!!!
 
Last edited:
Junior Spellweaver
Joined
Jan 7, 2012
Messages
147
Reaction score
100
Something like:

Code:
$lastUser = mysql_fetch_assoc(mysql_query("SELECT * FROM ". TB_PREFIX . "users ORDER BY id DESC LIMIT 1"));

(i've not tested)

Maybe order by act time.
 
Upvote 0
Banned
Banned
Joined
Sep 17, 2011
Messages
71
Reaction score
1
ok, but dont work for me, whem im put the code only show me this"Array", For whats?
 
Upvote 0
Skilled Illusionist
Joined
Jun 24, 2010
Messages
351
Reaction score
360
ok, but dont work for me, whem im put the code only show me this"Array", For whats?

$lastUser = mysql_fetch_assoc(mysql_query("SELECT * FROM ". TB_PREFIX . "users ORDER BY id DESC LIMIT 1"));

simple!
add this code:
PHP:
echo $lastUser['username'];
 
Upvote 0
Banned
Banned
Joined
Sep 17, 2011
Messages
71
Reaction score
1
Wow, omg!!!! You are genious??? Thanks my friend, the post is closed xd!!!
 
Upvote 0
Back
Top