Welcome Guest, Not a member yet? Register   Sign In
problem with refresh data
#11

[eluser]cipherz[/eluser]
it has the same behavior Sad
really have no clue what wrong.
#12

[eluser]mi6crazyheart[/eluser]
Can u show me u'r VIEW file code? Also , try this & tell me what's showing ...
Code:
function index()
  {
      $this->load->model(‘Member’);
      $main[‘content’] = $this->Member->list();  
      echo count($main[‘content’]); // This will show how many records has been selected by your model.
      $this->load->view('member/layout', $main);
  }
#13

[eluser]cipherz[/eluser]
model return the same result like before i added which is wrong. It should add one more. Actually the item is added to database. But after i press refresh or ADD ANOTHER entry, then it will show that need added item. So it is kinda 1 step slower.
#14

[eluser]mi6crazyheart[/eluser]
Strange!!!
ok, can u show u'r DB table structure and the code of u'r "member.php"(MODEL) file...
#15

[eluser]cipherz[/eluser]
DB table
members
id int(11) auto increment
firstname varchar(255)
lastname varchar(255)


Model
class Member extends CI_Model {
function __construct()
{
parent::CI_Model();
}
function getList()
{
$this->db->select('*');
$this->db->from('members');
return $this->db->get();
}
#16

[eluser]mi6crazyheart[/eluser]
Hey, the model function name at here(above given code) is "getList()" but from u'r controller u r calling model function "list()"
Controller code:
Code:
function index()
  {
      $this->load->model(‘Member’);
      $data[‘list’] = $this->Member->list();
      $main[‘content’] = $this->load->view($this->folder.‘index’, $data, true);
      $this->load->view($this->folder.‘layout’, $main);
  }


Any way, if that was just a writing mistake then use this following code in u'r model file to extract the members list & tell me what's showing.
Code:
function getList()
{
  $query = $this->db->get('members');
  return $query->result();
}
#17

[eluser]cipherz[/eluser]
hi sorry for the slow reply... i think there might be some wrong configuration or something since the same code work in CI 1.7

Thank you very much for your help .... i will just stick with CI 1.7 for now
#18

[eluser]InsiteFX[/eluser]
Your problem is that your web broswer is caching the page.

Try turning off your browsers cache.

InsiteFX
#19

[eluser]intractve[/eluser]
To Redirect to your index function you shouldn't redirect('index');

it should be
Code:
redirect('/members'); // or redirect(base_url(). 'members/');
// calling the above will redirect to the members controller's index function
// when you do - redirect($this->folder.‘index’);
// it goes to <&lt;base_url&gt;&gt;/do_create_item/members/index

Hope it helps
#20

[eluser]cipherz[/eluser]
thanks for the comments...i find this strange because it is working on some pages while other pages i have to press refresh.

For turning off browser cache, we cant control users to turn it off.




Theme © iAndrew 2016 - Forum software by © MyBB