• Unfortunately, we have experienced significant hard drive damage that requires urgent maintenance and rebuilding. The forum will be a state of read only until we install our new drives and rebuild all the configurations needed. Please follow our Facebook page for updates, we will be back up shortly! (The forum could go offline at any given time due to the nature of the failed drives whilst awaiting the upgrades.) When you see an Incapsula error, you know we are in the process of migration.

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