Jump to content
MakeWebGames

List usernames on specific file


Paddy

Recommended Posts

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;
Link to comment
Share on other sites

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);
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.

×
×
  • Create New...