Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Data Model Questions /

Editing $db = array() values via Controller


Reply


3 Posts   363 Views

Avatar
knsqnt

Community Member, 85 Posts

4 October 2013 at 4:34pm

Hi,

I execute a function from the controller and want to update a variable stored at $db = array(), but I don't get it...

Here is a pastie with my code: http://pastie.org/8376525

Thanks.

Avatar
Willr

Forum Moderator, 5513 Posts

4 October 2013 at 7:52pm

Looks like you're there. You should be able to call the URL of your page such as mysite.com/mypage/makeUpdate and it should run. Do you get an error? That makeUpdate function should probably return something, either redirect the user to another page or show them some sort of error message.

Avatar
knsqnt

Community Member, 85 Posts

4 October 2013 at 7:56pm

This is so wired.

When I access the variable in the controller, it contains the correct values, but it seems, that they are not written to the database.

Means, when I try to read em back in - either via the controller or the CMS backend - they don't contain the changes.

Sorry, no error message, even nothing inside the Apache logs.