I'm at wits end trying to solve this problem in my database. So when a
user goes to add another user, the two user keys are added to the
database but when the other user goes to accept the request including
an expiry date for the add, it creates a new column with just the
expiry date and null fields. here is my add and approve functions any
help would be greatly appreciated.
public function add(){
if($this->request->is('post')){
$this->Relationship->create();
if ($this->Relationship->save($this->request->data))
{
$lastId=$this->Relationship->id;
$this->Session->setFlash('The relationship has been saved');
}
else { $this->Session->setFlash('The relationship could not be
saved. Please, try again.'); }
}
}
public function approve(){
if($this->request->is('post')){
$this->request->data('Relationship.$lastId');
$this->Relationship->save($this->request->data);
$this->Session->setFlash('The information has been saved');}
else{$this->Session->setFlash('The information couldnt be
saved');}
}
--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Friday, May 25, 2012
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment