1

I have a hierarchy like parent->child1->child2... and so on

And the main thing in this, developing of an array is only one's while insert/editing (I am working on zend).

Now, I want prevent updating my parent_id while in edit case of child.

I have used this, but its not working well

$data = array('fieldname'=>$request['name'],
              'fieldname2'=>$request['xyz']
);

if(!isset(update)){    
  array_push($data,'parent_id'=>$request['parent_id']);
}

1 Answer 1

2

You can't use array_push() in this context.

Just do this

if(!isset(update)){    
  $data['parent_id']=$request['parent_id'];
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.