Page not viewing all entries

I have a page that will allow the user to input data. And on this page, there I have a combo box that will display records based on the selected option on the combo box using ajax. However, every time I insert record on the database, it does not display the current records instead it displays the previous records. Can anyone give me an idea why is this happening?

It may be happening due to caching. Caching can occur at many different levels, for example: your web browser, your local server, your ISP, the remote server.

You can check the timestamp of the ajax data to try and narrow down where the caching is occurring.

There are also articles on how to prevent this issue, one of which is:
Prevent AJAX URL caching

Thank you so much.

I should note that adding additional time and/or date data on to your querystring is only a work-around.

An improved solution can be achieved by using a no-cache header on the php script that’s providing the data. That way the work-around will no longer be required.

It’s a matter of semantics. Where the information being requested is time sensitive, such as retrieving data after a certain date, or between different times, there it is perfectly fine.

Where the date and time bear no relation to the information being retrieved, and are only being added to fix a server-side problem, that is where it is considered to be a work-around. The date/time is not used to modify the data, but instead is used to work around the server-side problem.

Once the the server is working properly, the date/time can then be removed, as it’s no longer needed to get around the problem that used to exist.

Gotta admit I’ve always found the only way to avoid caching is to call a unique url EG the normal url with a timestamp added to the end. Works flawlessly everytime.

@sirGE: Also be sure that your logic flow actually generate the html output from the db AFTER it has been inserted. I know that sounds obvious but you’d be surprised how many time I’ve done it.