Quantcast
Channel: CodeIgniter Forums - All Forums
Viewing all articles
Browse latest Browse all 14115

Tutorial - Use new table

$
0
0
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';

Viewing all articles
Browse latest Browse all 14115

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>