News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Dynamic Avatar, help needed

Started by BlindProphet, October 15, 2006, 10:11:55 AM

Previous topic - Next topic

BlindProphet

Okay, heres the situation:
I'm trying to create a Dynamic Forum Avatar (I believe VB had those).
The first version is going to be requested by the used ID, unless you guys can help me fully integrate it into SMF.
So $_GET gets the user ID, and retrieves memberName and prints it on the avatar.

What I need help with, is the correct MYSQL query needed to retrieve the info from the database.

Thanks in advance!  ;)
hxxp:blind.dx-t.net/board/index.php/board,3.0.html [nonactive]

Oldiesmann

SELECT IFNULL(realName, memberName) AS name FROM {$db_prefix}members WHERE ID_MEMBER = '$_GET[id]';

That's the basic query - the IFNULL part is important - it will pull the display name if it's set, otherwise it pulls their user name. Make sure you take the basic security precautions such as ensuring that the id is set and that it's an integer.
Michael Eshom
Christian Metal Fans

BlindProphet

hxxp:blind.dx-t.net/board/index.php/board,3.0.html [nonactive]

Advertisement: