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

I wonder which tutorial you've read. In the CI Tutorial about News, "news08" is never mentioned.
And I think you're mixing up database/table names with controller / method names.
CI doesn't want you to create a "news" database, just a "news" table.

The line
PHP Code:
$data['news08'] = $this->news_model->get_news(); 
in your code is just getting (all) news items from the table that you refer to in your model. It assigns the result to the 'news08' element of the $data array.
As a result, you can display the news-items in your view, by referring to the $news08 array (or object).

The code you are sharing here, is part of your controller.
Please, also show us what your news_model looks like.
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