Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Apr 2012
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy need help with my Member list

    im trying to display all registered users, my code is below.
    when i load the page it only show one of my users instead of all what do i add?
    also i would probably need to add a way of just showing 10 per page

    PHP Code:
    <?php

    include 'connect.php';
    include 
    'header.php';
    if(
    $_SESSION['signed_in'] == false)
    {
        
    //the user is not signed in
        
    echo '<a href="/forum/signin.php">sign in</a>to see our users';
    }
    else
    {
    }


    $nuser=$_SESSION['user_name'];
    $auser=$_SESSION['user_level'];

    if(
    $nuser)
    {
    $userfinal=$nuser;
    }
    else
    if(
    $auser)
    {
    $userfinal=$auser;
    }
    if(isset(
    $userfinal))
    {

    $Members mysql_query("SELECT * FROM users WHERE user_level ='0' ORDER BY user_id DESC ") or die(mysql_error());
    $name mysql_fetch_array($Members);
    $numRowsMembers mysql_num_rows($Members);
    }
    for(
    $count 1$count <= $numRowsMembers$count++)
     {
    }

    echo 
    '<a href="member_profile.php?username=' .$name['user_name'] .'">' .$name['user_name'] .'</a>';


    echo 
    '<br/>';
    include 
    'footer.php';
    ?>
    thanks

  • #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,858
    Thanks
    160
    Thanked 2,223 Times in 2,210 Posts
    Blog Entries
    1
    PHP Code:
    $Members mysql_query("SELECT * FROM users WHERE user_level ='0' ORDER BY user_id DESC ") or die(mysql_error());
    $name mysql_fetch_array($Members);
    $numRowsMembers mysql_num_rows($Members);
    }
    for(
    $count 1$count <= $numRowsMembers$count++)
     {
    }

    echo 
    '<a href="member_profile.php?username=' .$name['user_name'] .'">' .$name['user_name'] .'</a>';


    echo 
    '<br/>'
    That should be something like

    PHP Code:
    $Members mysql_query("SELECT * FROM users WHERE user_level ='0' ORDER BY user_id DESC ") or die(mysql_error());

    $numRowsMembers mysql_num_rows($Members);
    if (
    $numRowsMembers>0){
    while(
    $rowmysql_fetch_array($Members)){

    echo 
    '<a href="member_profile.php?username=' .$row['user_name'] .'">' .$row['user_name'] .'</a>';


    echo 
    '<br/>'
    }

    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #3
    New to the CF scene
    Join Date
    Apr 2012
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by abduraooft View Post
    That should be something like

    PHP Code:
    $Members mysql_query("SELECT * FROM users WHERE user_level ='0' ORDER BY user_id DESC ") or die(mysql_error());

    $numRowsMembers mysql_num_rows($Members);
    if (
    $numRowsMembers>0){
    while(
    $rowmysql_fetch_array($Members)){

    echo 
    '<a href="member_profile.php?username=' .$row['user_name'] .'">' .$row['user_name'] .'</a>';


    echo 
    '<br/>'
    }

    Thank you its working


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •