Welcome Guest, Not a member yet? Register   Sign In
Trying to show a single blog post
#21

[eluser]kaos78414[/eluser]
Went ahead and changed the model the way you said. No change. I already did this but just to make sure, I removed the .htaccess file and changed the config file index page to index.php. Still no change in the profiler.

As far as routes, I've only set the default route. There is no custom routing taking place at all.

I'll try a clean install, but seeing as how other routes work, and that I never edit outside the application folder, this probably isn't going to change anything.


*UPDATE* Same issue with a new install. I have absolutely no idea what could be going on. I'm pullin' my hair out over here lol
#22

[eluser]kaos78414[/eluser]
You think it might have to do with php.ini settings?
#23

[eluser]cahva[/eluser]
No, theres nothing in php.ini that could cause this.

What server do you use? Have you tried different $config['uri_protocol'] settings?
#24

[eluser]kaos78414[/eluser]
I'm running it locally on xampp for windows.

As for uri protocol, I've tried each of them. Auto, orig_path_info and path_info produce the same result. Query string brings a 404, as does request_uri

EDIT: Actually query string returns to the index function for some odd reason.

For something that should be so easy, this sure seems difficult.
#25

[eluser]deczo[/eluser]
Have you checked what your query:
Code:
...
$this->db->where('blogId', $blog_id);
$query = $this->db->get('blogposts');
...

returns?

If you don't get any error then only problem I would think of is empty result.
#26

[eluser]cahva[/eluser]
@deczo
We have already narrowed this problem not being the model. The uri doesnt work for some reason.

That said, how did you test this?

Create a test controller:
Code:
class Test extends Controller {

    function __construct()
    {
        parent::__construct();
        
    }
    
    function index()
    {
        redirect('test/testme/something');
    }
    
    function testme($param = FALSE)
    {
        $this->output->enable_profiler(TRUE);
    }

}

..and point your browser to http://localhost/your_app/index.php/test.../something (theres also index function that will redirect to that same address).
#27

[eluser]kaos78414[/eluser]
The query works, as when I pass the correct value to blog_id manually, it pulls the right blog entry. I only have two test entries in this project, with the ID's 1 and 2.

As for that test, it returns pretty much the same thing that we had before:

URI STRING
No URI data exists
CLASS/METHOD
test/testme
MEMORY USAGE
1,924,968 bytes
BENCHMARKS
Loading Time Base Classes 0.0236
Controller Execution Time ( Test / Testme ) 0.0287
Total Execution Time 0.0525
GET DATA
No GET data exists
POST DATA
No POST data exists
DATABASE: ci_example QUERIES: 0
No queries were run
#28

[eluser]cahva[/eluser]
I give up Sad I cant think of anything else and how you would correct it.

You could you test it using Wamp. Dont worry, it wont mess with your xampp. You dont have anything to lose here Smile
#29

[eluser]kaos78414[/eluser]
Okay so I tried to install WAMP and for some reason ran into all kinds of problems. So what I did was move to a different computer, install xampp, fresh codeigniter install, and rewrite all the code from scratch. So far things are looking good but I'll let you know.
#30

[eluser]kaos78414[/eluser]
Aha! I discovered something. As soon as I autoload the URI library I lose all my URI data, according to the output profiler. I wonder if its a bug...?


*EDIT* Yes! You're code works fine so long as I'm not auto-loading the URI library. What's with that?

*EDIT* Maybe this is why: "Note: This class is initialized automatically by the system so there is no need to do it manually."




Theme © iAndrew 2016 - Forum software by © MyBB