Jump to content

[SOLVED] Quick Memberlist Help


Cetanu

Recommended Posts

I've got this code and I just need to know why it won't display. What have I done wrong? I made the if...else... statement myself, so it's probably around there. :D

<?php

$result = mysql_query("SELECT * FROM users") 
or die(mysql_error());  

echo "<b>Username</b><br/>";

while($row = mysql_fetch_array( $result )) {
// Print out the contents of each row into a table 
echo "<table width='100%'>";
        echo "<tr><td width='33%'>";
        echo $row['username'];
        echo "</td>"; 
        echo " <td width='33%'>| <a href=\"profile.php?username=".$row['username']."\">Profile</a> | </td>";
        echo "<td width='33%'>";
        if (($row['username'])=={($_SESSION['username'])}){ 
        echo "This is YOU."; 
        }
       else{ 
      echo "Click to read more about" .$row['username'].;
      echo "</td></tr></table>"; 
        }
} 
?>

Link to comment
https://forums.phpfreaks.com/topic/166238-solved-quick-memberlist-help/
Share on other sites

first off, you don't need anywhere near the number of parentheses or braces you're using in the if() conditional:

 

        if ($row['username'] == $_SESSION['username'] ){ 

 

second, the issue is with this line:

 

      echo "Click to read more about" .$row['username'].;

 

i'm not sure why you're trying to concatenate (attach) the semicolon to your string. remove that period.

 

finally, in order to ensure you're seeing errors, you will want to place the following at the top of your pages until the script is published:

 

error_reporting(E_ALL);
ini_set('display_errors', 'true');

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.