send to page! - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: send to page! (/showthread.php?tid=22748) |
send to page! - El Forum - 09-18-2009 [eluser]WebbHelp[/eluser] Hi! I am creating a blog, and I point out that I am a beginner with CodeIgniter When you in the blog, have post a new blogpost, a function add is running, and the post are being add in the database: Code: $this->db->insert("posts", array('subject' => $subject , 'message' => $message)); You see, when I post in the database, the page that shows all blogposts is loaded. The problem is how can I make the page blog_view to reload or something like that. Because when I add a post in the database and then load the blog_view, I don't see the new post I just added, because I need to reload the page before. Thanks //WebbHelp send to page! - El Forum - 09-18-2009 [eluser]Damien K.[/eluser] Code: $this->load->view('blog_view',$this->data); This response is based on certain assumptions. Your code above pass the data to your blog_view page. However, $this->data was populated with all the blog posts before the newly inserted post, so you don't see the new blog post. Insert your post first then populate $this->data. send to page! - El Forum - 09-18-2009 [eluser]InsiteFX[/eluser] redirect('blog_view', 'refresh'); Enjoy InsiteFX send to page! - El Forum - 09-19-2009 [eluser]WebbHelp[/eluser] Yes. you both right, why didn't I think about that Damien . K. You right, I put the posts in $data before I insert. Thanks for helping |