Welcome Guest, Not a member yet? Register   Sign In
Tutorial - Use new table
#1

(This post was last modified: 11-18-2017, 09:39 AM by JeffreyB. Edit Reason: for clarity )

I am trying to use a second table in my 'news' database as setup in the CI Tutorial. It might be helpful if the Tutorial entries for database and table were not called the same thing - news. Anyway, I am trying to NOT use the 'news' table, but rather ONLY use the 'news08' table which I created in I guess what is the default database 'news'. As you can see in my code below, I am having difficulty pointing to the table I want - news08, which what I thought was correct syntax is commented out. I THINK that is my issue anyway. I have tried many other ways of phrasing this. Some actually process the tutorial code, but head to the database directory news/news instead of news/news08 where I want to go. Also, when I go back to using parts of the Tutorial code, I get other, but understandable and expected errors, so I believe this is my problem. I have also adjusted routes.php several different ways, and database.php also, and just haven't hit the right combination. As I said, news/news =  database/table sure adds to  permutations lol. Not to mention the Tutorial controller is 'news.php' and Tutorial views is /news. (This could get very musical - please check my newsviews, or my controllernews which is interfering with my newsroutes or possibly my newsmodel. Oh well Smile )

     public function __construct()
        {
                parent::__construct();
                $this->load->model('news_model');
                $this->load->helper('url_helper');
                $this->load->library('table');
        }

        public function index()
        {
  //    $data['news'] = $this->news_model->get_news('news/news08');
        $data['news08'] = $this->news_model->get_news();
        $data['title'] = 'Now changed from Tutorials News archive';
Reply


Messages In This Thread
Tutorial - Use new table - by JeffreyB - 11-18-2017, 09:34 AM
RE: Tutorial - Use new table - by Wouter60 - 11-18-2017, 12:26 PM
RE: Tutorial - Use new table - by JeffreyB - 11-18-2017, 08:56 PM
RE: Tutorial - Use new table - by JeffreyB - 11-18-2017, 09:00 PM
RE: Tutorial - Use new table - by InsiteFX - 11-18-2017, 12:39 PM
RE: Tutorial - Use new table - by Wouter60 - 11-19-2017, 12:52 AM
RE: Tutorial - Use new table - by InsiteFX - 11-19-2017, 05:06 AM
RE: Tutorial - Use new table - by JeffreyB - 11-20-2017, 12:42 PM



Theme © iAndrew 2016 - Forum software by © MyBB