0
私のモデルでは、難易度というフィールドがありますが、どのような値を指定しても、値1がデータベースに保存されます。Cakephpはフィールドを保存するように指定していますか?
私は、これは私が見たものである私は(保存)していた前モデルにdatadumpをした:
Array
(
[title] => testtt34
[serves] => 32
[prep_time] => 32
[cooking_time] => 32
[difficulty] => 4
)
しかし、SQLクエリCakePHPは生成されたが、これです:
INSERT INTO `recipes` (`title`, `serves`, `prep_time`, `cooking_time`, `difficulty`, `modified`, `created`) VALUES ('testtt34', 32, 32, 32, 1, '2011-03-13 19:15:16', '2011-03-13 19:15:16')
何一体?難易度は明らかに4私のdatadumpで、SQLを挿入困難= 1
//Do some checking to make sure the data is from proper location
$this->data = Sanitize::clean($this->data);
$this->Recipe->data = $this->data;
//error checking
$this->pa($this->Recipe->data['Recipe']);
if ($this->Recipe->save())
{
//Blah do some stuff
}
dbの難易度フィールドのデータ型は? – deceze
うわー、それはダムだった、それはTINYINT(1)>< –