Cetanu Posted July 16, 2009 Share Posted July 16, 2009 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. <?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 More sharing options...
akitchin Posted July 16, 2009 Share Posted July 16, 2009 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'); Link to comment https://forums.phpfreaks.com/topic/166238-solved-quick-memberlist-help/#findComment-876661 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.