Topic: Check this out!

<?php
// This is where I get user info
$query = 'SELECT id, username, iwins, ilosses, ipoints FROM punbb2_users';
$result = mysql_query($query) or die('Query failed: ' . mysql_error());
        
$line = mysql_fetch_array($result, MYSQL_ASSOC);
?>

<dl>
     <dt>Player: </dt>
    <dd><?php echo $line['username'] ?></dd>
    <dt>Wins:</dt>
    <dd><?php echo $line['iwins'] ?></dd>
    <dt>Losses:</dt>
    <dd><?php echo $line['ilosses'] ?></dd>
    <dt>Points:</dt>
    <dd><?php echo $line['ipoints'] ?></dd>
    <dt>To Player:</dt>
    <dd><a href="">Send Challenge</a><a href=""> </a></dd>

Okay so this is part of a custom profile I created for my users. To see an example go to this site. Click one of the usernames and it will take you to the page where the above code is used.

Now the problem is that it is always using the same user to output no matter which user you click on. Why is this happening? How can I fix it?
If you want more info leme know.

Re: Check this out!

Why is it always the same user? Because your query doesn't have a WHERE statement that specifies which user you're looking at. tongue
Your query grabs all the rows from the users table and your code grabs the first row from the set and spits out data based on that

Re: Check this out!

Yea I actually got it all working again I was gona dlt post.

You are right though, I used a WHERE clause to get everything going.

Thanks