php display NickName of given user id?

Hi, I'm making a few custom pages and SQL submission forms and have managed to get the user ID of the person thats created a row in to the SQL, but i want it to display the users Nickname when the results are printed instead of the user ID.

i've tried

getProfileInfo( $results['UserID'] );

but to no avail (the page just displays "Array"). I'm pretty new to php and cant yet get my head around arrays, if anyone can help i'd very much appreciate it! :)

Quote · 19 Jun 2008

$nick = mysql_query("SELECT `NickName` FROM `Profiles` WHERE `ID` =1");

echo "$nick";

this for some reason is returning "Resource id #3"

but when i run the command from within MySQL, it works fine, any ideas?

Quote · 19 Jun 2008

Use function - function getNickName( $ID = '' )
:)

its already in

profiles.inc.php

Quote · 19 Jun 2008

Thanks, i got it.

for anyone else trying stuff similar to the bits i'm currently working on, here's how i got it working.

$creator = getNickName( $results['UserID'] );

echo "$creator";

so:

$creator = getNickName( 12 );

echo "$creator";

will echo the NickName of the user with the id 12 :)

Thanks for your help AndreyP!

Quote · 19 Jun 2008

I was looking around how can i echo the complete url of the user under the profile picture or into a block..

As lets say

http://www.mysite.com/myusername

I cant make it work.. anyone?

Quote · 14 Nov 2008
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.