0

I am currently coding a board, quite similar to a chan at this point in it's life but it wont end as such. Anyways currently I have a basic system working boxes up top, type in than it posts down below. Now to display the information (it is inserted into a mysql table) I perform a mysql query to pull out the information and than do a mysql_fetch_assoc, that goes into the while loop parameters and than I put in what I want to loop so the section is as follows.

$get_posts = mysql_query("SELECT `title`, `content`, `time`, `id`, `user` FROM `General - Off Topic` ORDER BY time DESC");
while($get_posts_thing = mysql_fetch_assoc($get_posts)) {
echo $get_posts_thing['title'];
echo $get_posts_thing['content'];
}

Thats basically what it looks like but it's in a div for styling. Anyways I want to make a reply system where you click the reply button and a text box appears and you type in your reply and click post. I want the post to appear under the post being replied to, styled in a div. Since it's in a while loop I cant individually pick things out. Any suggestions? And sorry this is my first post and my first real php project so I don't know some things.

nickb
  • 59,313
  • 13
  • 108
  • 143
NardCake
  • 130
  • 2
  • 9

1 Answers1

0

Inside your loop, have a <button onClick="reply(this);>. Then in your JavaScript, define the reply function to take the button as its argument, and then work from there to put in the textbox etc.

Niet the Dark Absol
  • 320,036
  • 81
  • 464
  • 592