September 17th, 2013, 11:32 PM
Cache? I can see database updates after refreshing!
When I update the database I need to refresh the page to see the changes. Why is that? How can I fix that?
I havent set cache anywhere! I added this to the code. But it did not make any difference.
And this to <head>
$this->output->set_header('Last-Modified: ' . gmdate("D, d M Y H:i:s") . ' GMT');
$this->output->set_header('Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0');
$this->output->set_header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
Jesus loves you
<meta http-equiv=“pragma” c />
<meta http-equiv=“Expires” c />
<meta http-equiv=“CACHE-CONTROL” c />
September 18th, 2013, 01:07 AM
You're probably running the queries before you've done the updates. Causality doesn't let you get changed data before you've changed it.
September 18th, 2013, 05:00 AM
totally confused here. If you update something in the database, you need to refresh so queries RE-RUN again to get the right counts etc?
September 18th, 2013, 05:11 AM
I'm a l;ittle confuesed too. Is it possible that you could use Ajax to give you pseudo live results ?
September 18th, 2013, 05:59 AM
We need to see the code. Without the concrete code, it's all just speculation.
What requinix says is that you might have fetched the data you wanna display before you did the update. In that case, you obviously see the old data. If you wanna see the updated data immediately, you must do the update on top of the script.
Comments on this post
September 18th, 2013, 08:42 PM
I update in one page and then show a link on screen for users to click and see the results.
foreach($this->input->post('x_id') as $count => $row)
$this->posted_data = array(
$this->db->update_batch('thx_daily', $this->posted_data, 'x_id');
In the next page retrieve:
$data_results['thx'] = $this->model_thx->load_thx_vouchers($id);