A few Ideas:
* set your primaryKey attribute to 'ID' in the model:
http://book.cakephp.org/2.0/en/models/model-attributes.html#primarykey
* debug the return value of your save($data) call
* debug $this-Player-validationErrors after the save call
* try setting the model ID ($this-Player-id = $playerID) and then save
or saveField
Max
On 09/16/2012 11:18 PM, d6games wrote:
The following code in my PlayersController doesn't error but also
doesn't save anything to the database table...
private function authorize($tag, $pass) {
$findPlayer = $this-Player-find('first', array(
'conditions' = array('Tag' = $tag, 'Password' = $pass)
));
$playerID = 0;
if ( count($findPlayer) 0 ) {
$playerID = $findPlayer['Player']['ID'];
$data = array('id' = $playerID, 'CurrentLogin' = date('c'));
$this-Player-save($data);
}
unset($findPlayer);
return $playerID;
}
In my table the id field is actually ID, however if I change the
$data line above to ID, then cake switches to Insert mode and blows
up. So far nothing I do will update the table. What am I doing wrong?
Thanks for your advice. I'm spinning my wheels...
Mark
--
Like Us on FacekBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
---
You received this message because you are subscribed to the Google
Groups CakePHP group.
To post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
--
Like Us on FacekBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
---
You received this message because you are subscribed to the Google Groups CakePHP group.
To post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.