php - Comments are not working and blank data constantly created -


i have post , comment input sent database echoed out if id same post id partially works every time page refreshed id same post there no input, code.

    $id = $_get['id'];     $query = mysql_query("select * forum id = '$id'");     $query2 = mysql_query("select * comments id = '$id'");     $data = mysql_fetch_array($query);     echo "<div class='post'>" . "<div class='leftside'>" . "<h3 class='by'>" . $data['user'] . "</h3>" . "<h5 class='date'>" . $data['time'] . "</h5>" . "</div>" . "<div class='after'>" . "</div>" . "<div class='rightside'>" . "<h2 class='title'>" . htmlspecialchars($data['title']) . "</h2>" . "<p class='description'>" . htmlspecialchars($data['description']) . "</p>" . "<p class='question'>" .htmlspecialchars($data['post']) . "</p>" . "<form action='' method='post'>" . "<input class='comment' type='text' name='comment' placeholder='add comment'>" . "</form>" . "</div>" . "<div class='clear'>" . "</div>" . "</div>";      $comment = $_post['comment'];      mysql_query("insert comments (id, comment) values ('$id', '$comment')")     or die ('failed post comment please try again');     while($data2 = mysql_fetch_array($query2)){    echo "<div class='comment'>" . $data2['comment'] . "</div>";     } 


Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -