Tell me more ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

When I use the built in PDO layer in TinyMVC to request records from a table, it returns the following error:

Array
Error: 0
Message: Unknown file 'register_view.php'
File:{redacted}tinymvc\sysfiles\plugins\tinymvc_view.php
Line: 125

When I however try just returning the same variable without a connection it displays it fine. The error it is raising is in the view layer because it cannot get the parameter passed to it. However I see no reason why it is doing that considering the query is running ok.

Here is the code from the view method:

<body>
<h1>Hello <?=$fname?></h1>
<p>Hello World</p>

And the code from the controller:

function index(){
    $this->load->model('User_Model','user');
    $this->view->assign('title','Manage your Peacock account');
    $this->view->assign('fname', $this->user->fname());
    $this->view->display('user_view');
}

Finally the code from the model:

public function __get($property) {
    if (property_exists($this, $property)) {
        /**
         * Retrieve the data from the database
         */
        $this->$property = $this->db->query_one('select '.$this->getTable($property).' from users where id=?',array('1'));
        return $this->$property;
    }
}

Any help will be appreciated

share|improve this question
 
Isn't the error Unknown file 'register_view.php'? Seems more like an incorrect file path issue or something similar –  Phil 1 hour ago
 
It would seem so.however I have included the file directly and still get the same error.the error only occurs when I am using the database object –  kaiten65 1 hour ago
 
I'd start at line 125 of tinymvc\sysfiles\plugins\tinymvc_view.php and work backwards from there, preferably using a debugger –  Phil 1 hour ago

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.