Re: [Models] saveAll doesn't work

2012-08-01 Thread TWEESTY
Hi!

I know it, but my field body is not null!

Here my array :

Array ( [Topic] => Array ( [subject] => ZEZEEZ [user_id] => 3 ) [Message] 
=> Array ( * [body] => QSDDD * [user_id] => 3 ) [Belong] => Array ( 
[user_id] => 3 ) )

Thanks


Le mercredi 1 août 2012 18:39:01 UTC+2, Jamie a écrit :
>
> Did you look at the clear-as-day MySQL error you were given?
>
> "SQLSTATE[23502]: Not null violation: 7 ERROR: null value in column "body" 
> violates not-null constraint"
>
> You are entering in a null value into the "body" column which does not 
> allow null values. So either change the table so that "body" DOES accept 
> null values, or ensure that the data you're saving has a non-null "body" 
> value.
>
> On Tuesday, July 31, 2012 3:12:03 AM UTC-7, TWEESTY wrote:
>>
>> Up. 
>>
>> Thanks ! 
>>
>

-- 
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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: [Models] saveAll doesn't work

2012-08-01 Thread Jamie
Did you look at the clear-as-day MySQL error you were given?

"SQLSTATE[23502]: Not null violation: 7 ERROR: null value in column "body" 
violates not-null constraint"

You are entering in a null value into the "body" column which does not 
allow null values. So either change the table so that "body" DOES accept 
null values, or ensure that the data you're saving has a non-null "body" 
value.

On Tuesday, July 31, 2012 3:12:03 AM UTC-7, TWEESTY wrote:
>
> Up. 
>
> Thanks ! 
>

-- 
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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: [Models] saveAll doesn't work

2012-07-31 Thread TWEESTY
Up. 

Thanks ! 

-- 
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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


[Models] saveAll doesn't work

2012-07-30 Thread TWEESTY


Hi all!

I have one problem with the methode saveAll. I do a saveAll and i have this 
error :

SQLSTATE[23502]: Not null violation: 7 ERROR: null value in column "body" 
violates not-null constraint

Here, my models :

class Topic extends AppModel {
public $name = 'Topic';
public $belongsTo = 'User';
public $hasMany = array('Belong', 'Message');

class Message extends AppModel {
public $name = 'Message';

public $belongsTo = array('User', 'Topic');

class Belong extends AppModel {
public $name = 'Belong';

public $belongsTo = array('User', 'Topic');
   
}

I use saveAll inside the model Topic, here the array transmitted at my 
method.


Array ( [Topic] => 
 Array ( 
   [subject] => ZEZEEZ 
   [user_id] => 3 ) 

[Message] => Array ( 
  [body] => QSDDD 
  [user_id] => 3 )

[Belong] => Array (
   [user_id] => 3 ) )

Request :


$this->Topic->saveAll($this->request->data);

My body's field is filled !

Thanks guys!

-- 
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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php