Jump to content

Comments refresh


TeddyKiller

Recommended Posts

I've got a div refresh setup using JQuery.

The problem is.. I want to refresh the comments every so many seconds.

The comments are in a while function.. because it's for status's.. each status has a comment section.

 

The comments while function is dependant on the status ID. If I did a JQuery refresh, it would not work.. as the page in which is being loaded into the DIV.. wouldn't have the status ID past to it.

 

The option that I can think of is putting the whole thing, including the status in. Although not only would this check for status updates.. it would refresh the whole thing, so if someone was commenting.. and it refreshed.. Boom.. its gone.

 

The while function for the status' is very unhealthy.

The while gets the status fine.. although somehow I need to attach a comment section for each status. I would also need a while function to get the comments, which is dependant on a select query. All that.. is in the while function for the status.

 

I can't think of a way around it? It's just temporary, I'll be putting them into functions.. although tips on making it .. healthier would be appreciated.

 

So.. the question is.. how can I pass the $row['id'] to the page to be loaded into the DIV so I can do the queries with it.

 

I'm not sure if this is the right place, I don't know if it can be done with just PHP, or its got to be done with Ajax..

 

Any help?

Thanks

Link to comment
https://forums.phpfreaks.com/topic/200799-comments-refresh/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

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