Trying to show a single blog post |
[eluser]kaos78414[/eluser]
For some reason this brings up a blank page. That's weird because it should at least load my header and footer. I'm assuming it's passing false for some reason because $blod_id does not have a value? My read more links look like this: Code: echo anchor('blog/view/'.$row->blogId, 'Read on');
[eluser]cahva[/eluser]
Well $row->blogId should contain the id right? Ofcourse it doesnt work if theres no id ![]() Does it work if you just use url http://www.yourdomain.com/blog/view/12 (or any other id that exists).
[eluser]kaos78414[/eluser]
The link points to the correct ID. I'm really not sure what's going on here. The database returns results correctly if I just do a simple get('blogposts') active record query.
[eluser]cahva[/eluser]
Just add this to the view method: Code: $this->output->enable_profiler(TRUE); That will tell you the queries run + much more.
[eluser]kaos78414[/eluser]
Weird. No URI data, no queries. Nothing seems to be happening at all. Any ideas?
[eluser]cahva[/eluser]
That is weird. Does that profiler give you anything in other controllers?
[eluser]kaos78414[/eluser]
Nope. Under class/method it says blog/view Everything else is either benchmarks/memory usage or is empty.
[eluser]cahva[/eluser]
Do you use routes? Thats the only thing that I can think of.. Maybe you should paste the whole controller here so we can have a looksee.
[eluser]kaos78414[/eluser]
Here's the controller blog.php Code: <?php And this is the entire model file at blogmodel.php Code: <?php
[eluser]cahva[/eluser]
Only thing I see here that could cause problems(but I doubt) is the BlogModel's constructor: Code: function Blogmodel() { You can set the constructor with __construct() in every controller and model: Code: function __construct() But as I said, I doubt this causes the error. The error is in uri right now as you dont seem to get any vars passed to your method and is not actually related to the model itself. Do you use any kind of routes(you forgot to say that)? You said earlier that its not an htaccess issue. You sure? ![]() If this problem wont solve, you better do an clean CI install and make a test controller to see that uri works as it should. |
Welcome Guest, Not a member yet? Register Sign In |