Hey guys,
I am using ajax and php to insert comments from users into the database. I have it to where after the user submits a comment, that most recent comment shows up on the page, but after refresh, all the displayed records are gone. The comments still remain in db, but not the page itself. It's because of the refresh, but I want them to remain on the page.
That said, I already have a function that retrieves the comments from the db written in php. Is there any way to just send the most recent comment to this php function so that the most recent comment shows up WITHOUT having to refresh the page? or do I have to create a function using ajax to retrieve the records? If I have to do it in ajax, can somebody please show me an example of how to fetch a record from a database and display it to a specified page? Thanks for the help.