pouncer Posted January 23, 2007 Share Posted January 23, 2007 [code=php:0] function GetUserNameFromID($id) { $sql = mysql_query("SELECT username FROM users WHERE userid='$id'"); return what??; }[/code]how do i actually return the username Link to comment https://forums.phpfreaks.com/topic/35351-query-help-in-php/ Share on other sites More sharing options...
ted_chou12 Posted January 23, 2007 Share Posted January 23, 2007 you will need to add:$row = mysql_fetch_array($sql);return $row['username'];Ted Link to comment https://forums.phpfreaks.com/topic/35351-query-help-in-php/#findComment-167082 Share on other sites More sharing options...
pouncer Posted January 23, 2007 Author Share Posted January 23, 2007 perfect, thanks. Link to comment https://forums.phpfreaks.com/topic/35351-query-help-in-php/#findComment-167084 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.