Edit Pages |
Davy,
With these basic php questions, I recommend trying to post your questions here: http://www.codingforums.com/php/
Codeigniter is simply one of the tools you need to learn to be a successful developer. Always add more tools to your coding arsenal!
Put this code right above <?php foreach ($pages as $pages_item): ?>:
PHP Code: echo '<pre>'; Good chance it's empty, and by no means an array. Because your model returns this: PHP Code: return $this->db->update('pages', $data); Now that I've put you on the right track, I hope you will solve the rest of the problem on your own. Don't keep asking the same (type of) questions over and over again.
Fatal error: Call to a member function result() on boolean in C:\Program Files (x86)\EasyPHP-Devserver-16.1\eds-www\CompanyGiondaCI\application\models\Mpages.php on line 197
A PHP Error was encountered Severity: Error Message: Call to a member function result() on boolean Filename: models/Mpages.php Line Number: 197 Backtrace: controllers/Cpages.php PHP Code: public function updatesettings() { views/settings.php PHP Code: <div class="widget-box"> models/Mpages.php PHP Code: public function add_settings()
" If I looks more intelligence please increase my reputation."
And what do you think that the Query Builder is returning for the update method? Maybe look at the CI code!
It sure is not returning an array. What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
I update it into something else:
models/Mpages.php PHP Code: public function add_settings() There is a new error that I do not know how to fix it: Fatal error: Call to a member function result_array() on boolean in C:\Program Files (x86)\EasyPHP-Devserver-16.1\eds-www\CompanyGiondaCI\application\models\Mpages.php on line 197 A PHP Error was encountered Severity: Error Message: Call to a member function result_array() on boolean Filename: models/Mpages.php Line Number: 197 Backtrace:
" If I looks more intelligence please increase my reputation."
It's useless. Davy has pm'd me, we've all tried to tell him what to do but it's not getting to him. We've all been pretty patient, but Davy doesn't want to learn, he wants us to code for him. Can't help someone who doesn't want to be helped.
Codeigniter is simply one of the tools you need to learn to be a successful developer. Always add more tools to your coding arsenal!
$query = $this->db->update('setting', $data); ... this returns a boolean, which means that
$query->result_array(); will blow up with exactly the error message you report, because $query is not an object. See http://www.codeigniter.com/user_guide/da...er::update
Well, in that case I do not know how to use the boolean. I try this printing out echo to proof if it is successful.
views/settings.php PHP Code: <div class="widget-box"> controllers/Cpages.php PHP Code: public function updatesettings() {
" If I looks more intelligence please increase my reputation."
A PHP Error was encountered
Severity: Notice Message: Undefined variable: setting Filename: views/settings.php Line Number: 47 Backtrace: File: C:\Program Files (x86)\EasyPHP-Devserver-16.1\eds-www\CompanyGiondaCI\application\views\settings.php Line: 47 Function: _error_handler File: C:\Program Files (x86)\EasyPHP-Devserver-16.1\eds-www\CompanyGiondaCI\application\controllers\Cpages.php Line: 567 Function: view File: C:\Program Files (x86)\EasyPHP-Devserver-16.1\eds-www\CompanyGiondaCI\index.php Line: 315 Function: require_once A PHP Error was encountered Severity: Notice Message: Undefined variable: setting Filename: views/settings.php Line Number: 66 Backtrace: File: C:\Program Files (x86)\EasyPHP-Devserver-16.1\eds-www\CompanyGiondaCI\application\views\settings.php Line: 66 Function: _error_handler File: C:\Program Files (x86)\EasyPHP-Devserver-16.1\eds-www\CompanyGiondaCI\application\controllers\Cpages.php Line: 567 Function: view File: C:\Program Files (x86)\EasyPHP-Devserver-16.1\eds-www\CompanyGiondaCI\index.php Line: 315 Function: require_once A PHP Error was encountered Severity: Warning Message: Invalid argument supplied for foreach() Filename: views/settings.php Line Number: 66 Backtrace: File: C:\Program Files (x86)\EasyPHP-Devserver-16.1\eds-www\CompanyGiondaCI\application\views\settings.php Line: 66 Function: _error_handler File: C:\Program Files (x86)\EasyPHP-Devserver-16.1\eds-www\CompanyGiondaCI\application\controllers\Cpages.php Line: 567 Function: view File: C:\Program Files (x86)\EasyPHP-Devserver-16.1\eds-www\CompanyGiondaCI\index.php Line: 315 Function: require_once views/settings.php PHP Code: <?php
" If I looks more intelligence please increase my reputation."
I give up.
In your updatesettings method (2 posts ago), you only set $data['setting'] if validation succeeds. Of course you will get an undefined variable error message if you load the settings view if validation fails. I am out of patience and time to help you learn the basics of PHP programming. |
Welcome Guest, Not a member yet? Register Sign In |