Question about allowing comments

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
fivestarsoul182
Forum Newbie
Posts: 1
Joined: Mon May 24, 2004 6:19 am

Question about allowing comments

Post by fivestarsoul182 »

Alright I have been searching for a very long time but I can't find anything that will help me. I have a website and I post news, and I want people to be able to post comments on the news I post, like the main page of this site where people can leave comments on it. I have no idea how to do it and if someone could help me that would be greatly appreciated. Thank you.
d3ad1ysp0rk
Forum Donator
Posts: 1661
Joined: Mon Oct 20, 2003 8:31 pm
Location: Maine, USA

Post by d3ad1ysp0rk »

Posts table:
id | content | date

comments:
id | post_id | content | poster | email | date

Code: Select all

<?php
$result = mysql_query("SELECT * FROM comments WHERE post_id = '" .$_GET['id']. "'");
while($row = mysql_fetch_array($result)){
echo "Name: " .$row[poster]. "<br />";
echo "Email: " .$row[email]. "<br />";
echo "Content: <br />" .$row[content];
}
?>
Post Reply