Jump to content
MakeWebGames

id to username


peterisgb
 Share

Recommended Posts

hello, I got this problem.

i've added in a little mod i made which shows the user id last win and last lost.

It displays the users ID but idealy i want it to show the players username instead,

how do i go about doing this,

Here is what i have to this might help put me in the right direction.

Last Win: ID <a href='viewuser.php?u={$r['lastwin']}'><font color='green'>{$r['lastwin']}</font><br /></a>

Last Lost: ID <a href='viewuser.php?u={$r['lastlost']}'><font color='red'>{$r['lastlost']}</font><br /></a>

Link to comment
Share on other sites

i've updated this abit

 

$win= "{$r['lastwin']}";

$lost= "{$r['lastlost']}";

 

Last Win: ID <a href='viewuser.php?u={$r['lastwin']}'><font color='green'><b>$win</b></font><br /></a>

Last Lost: ID <a href='viewuser.php?u={$r['lastlost']}'><font color='red'><b>$lost</b></font><br /></a>

so anyhelp on displaying username?

Link to comment
Share on other sites

idea, this workd but now doing this affects the links,

What shall i do about that.

When placing mouse over the username it shows up the correct userid in the viewuser link but when you click this error comes up

QUERY ERROR: Unknown column 'N' in 'where clause'

Query was SELECT `username` FROM `users` WHERE (`userid` = N/A);

how would i go about solving this new problem.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...