Jump to content

Saving a field [ I am retarded |:\ ]


bramwolf
 Share

Recommended Posts

Hey Guys,

I've been trying to load a field from a different page, update it's value and save it. 

that's all,... and i CANT get it to work! Extremely frustrating <:(

	$bestelnummer = $fields->get('bestelnummer');
	$bestelnummer++;
	$fields->save($bestelnummer);
	echo $bestelnummer;

Can someone please help this poor little retarded boy out?  :(

Thanks guys!

Link to comment
Share on other sites

You are getting the general field itself, not the field in that page. Try this instead:



$other_page = $pages->get("selector_for_the_page");
$other_page->setOutputFormatting(false);
$other_page->bestelnummer = $other_page->bestelnummer++;
$other_page->save('bestelnummer');



  • Like 3
Link to comment
Share on other sites

I was? I never saw anything that pointed me towards this problem? 

Is there some specific place I should look for the error? Since i only

thing I recall is seeing "The error had been logged because you are logged in as administrator" 

a few times, but never a specific error other than Internal server error..

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...