Hi,

i have this code where a 1 or denotes whether to show a for to add comments or just show the comments with out the form, but it's constantly just showing the form, the comments and id's are getting stored in the database ok here is the code:

PHP Code:
        // Check Comments 
        
$query2 mysql_query("select * from `member_comments` where `mid`='$id2'") or die(mysql_error()); 
        
        
$id2 $id
        
        
$count_comments mysql_num_rows($query2); 
        
        
$form '<form action="comment_post.php" method="POST"> 
        <textarea name="comments" cols="20" rows="2">
        </textarea>
        <br />
        <input type="hidden" name="mid" value="'
.$id2.'">
        <input type="submit" value="Add Comment"> </form>'
// check that the comment view area is needed. 
        
if (!($count_comments=="0")) { 
        
$show_com '1'
           } else {
        
$show_com '0'
        } 
        
        
// If yes show comments if no only show form. 
        
if ($show_com == '1'
        { 
        while (
$row2=mysql_fetch_array($query2)) { 
                
        
$id2_com $row2[id]; 
        
$quick_name mysql_query("SELECT * FROM `membership` WHERE `id`='$row2[uid]' LIMIT 1") or die (mysql_error()); 
        
        while (
$n=mysql_fetch_array($quick_name)){ 
        
$mem_name $n["username"]; 
        } 
        echo 
'<hr />';        
        echo 
'Posted By: <a href="view_profile.php?id='.$row2[uid].'">'.$mem_name.'</a><br>'
        echo 
'On: '.$row2[posted].'<br>'
        echo 
'Comment: '.$row2[comments].'<br><br>'
        echo 
'<hr />';            
        }         
        echo 
$form
         } else {
        echo 
$form

cheers for any help

Graham