I am trying to add the viewed by 1 for each view but it will not save.

 

I have:

 

$viewed = $mail['Sendout']['viewed'];

                                    

$total = $viewed + "1";

// tried $total = $viewed ++;

// $total = $viewed + '1';

// $total = $viewed + 1;

 

 

 

debug($total); //shows db count plus 1

                                    

$this->Sendout->id = $mail['Sendout']['id'];

                                    

$this->data['Sendout']['lastview'] = date('Y-m-d H:i:s');// this field saves
the last view timestamp

$this->data['Sendout']['viewed'] = $total; // this never saves db is int(11)

                                    

$this->set('sendout', $mail);

 

$this->Sendout->save( $this->data, true );

 

Any ideas where I am going wrong?

 

Thanks

 

 

Dave

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

Reply via email to