2011-03-14 3 views
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') 

무엇 도대체? TINYINT (1) TINYINT (3), 잘 그게 고정 할 의도로 어려움을 내 datadump 명확 4에도 불구하고, 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 
} 
+2

db의 '난이도'필드의 데이터 유형은 무엇입니까? – deceze

+1

와우, 그건 바보 같았 어, TINYINT (1)>< –

답변

0

신경 끄시 실수로 어려움의 종류를 설정합니다. 아주 바보 같은 실수.

관련 문제