Paddy Posted July 9, 2010 Share Posted July 9, 2010 Hi Guys, I need to show a list of usernames on a specific page this is what ive done at the moment can anyone drive me to the right direction. i have a row in users_table which is current_page and if user is on index.php it says he`s on (index page) so i can follow where users are, but i want to convert current_page to a user_name list, so im probably missing something in the sql query any help will be appreciated include "global_engine.php"; $paddy=$db->query("SELECT `current_page` FROM users_table WHERE user_id=$user_id LIMIT 5"); $ass=$db->fetch_row($paddy); if($ir['current_page'] >= filename) { $current_page="----"; } else { $current_page="".$bbc->bbcode_parse(user_name($ass['user_id'])).""; } echo <<<EOT <table> <tr> <td>$current_page</td> </tr> </table> EOT; Quote Link to comment Share on other sites More sharing options...
Danny696 Posted July 9, 2010 Share Posted July 9, 2010 filename isn't real :/ And 'user_name' do you have that function. Quote Link to comment Share on other sites More sharing options...
Paddy Posted July 9, 2010 Author Share Posted July 9, 2010 lets say ive changed most of the things around and filename is just an example name of the file i want to show the user list so everything there is correct just missing something Quote Link to comment Share on other sites More sharing options...
Analog Posted July 9, 2010 Share Posted July 9, 2010 In your sql you are only selecting current_page however, later in the function you are trying to call the userid field, which you didn't select in the query. $paddy=$db->query("SELECT `current_page`, `userid` FROM users_table WHERE user_id=$user_id LIMIT 5"); $ass=$db->fetch_row($paddy); Quote Link to comment Share on other sites More sharing options...
Paddy Posted July 9, 2010 Author Share Posted July 9, 2010 thanks for the tips but was missing a while($ = mysql_fetch_assoc($paddy)) working now :) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.