Jump to content

Recommended Posts

on my website, I display posts/updates on the website's development, and I'm trying to make it so that with each post, a viewer can post a comment on it. I can't figure out how to make it so that each post can show different comments.

sorry if i'm not being so clear.

 

where the posts are displayed:

while($row=mysql_fetch_array($result)){

echo'

        <tr>
          <td height="20" class="title">'.$row['title'].'</td><td class="title"><div align="right">'.$row['date'].'
	  </div>
	</td>
      </tr>
  
<tr>
    <td height="100" colspan="2" class="content">'.$row['content'].'
</td>
    </tr>

<tr><td> <a href="javascript:toggle_visibility()" class="link">[comments]</a>
<div id="comments">hi</div>
</td></tr>';

}

 

Link to comment
https://forums.phpfreaks.com/topic/185149-comment-on-a-post-problem/
Share on other sites

SELECT * FROM Archive ORDER BY date DESC

My table for the posts has the columns of "title", "content" and "date". That part works fine (http://annarboruncovered.com/).

 

I'm going to set up a table for the comments with the columns of "content", "poster" and "date".

a column that you can store something unique at each article. For each article you could do something like

SELECT * FROM comments WHERE archive_id=?

 

and archive_id stores, say, the unique id's from the Archive table, or something to that will identify which article you are talking about

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.