What tram said... change the field to an Int. Mysql tinyint datatype
has traditionally been used to store boolean data as MySQL doesn't
have a boolean datatype.
Alternatively, use a 1 byte char field.
Or change your options to be
null = Pending (the database default)
0 = Disapprove
1 = Approve
Or use an enum. Note: enums are mysql specific and are not directly
supported by cake. This doesn't mean you can't use them though (cake
treats them as a standard varchar field). There are some behaviours
out there that can help with enums.
As to the white screen of death, check out the httpd error logs and
the cake error logs (app/tmp/logs/error.log)
On Aug 26, 11:45 pm, [EMAIL PROTECTED] wrote:
> oh cmon you dont expect good anwers when you're bashing the fw like that ?
>
> cake interprets int(1) as bool , its a design choice. you are welcome
> to update the book.cakephp.org to reflect that.
>
> "white screen of death" - sorry im not getting it with your code, you
> sure the radio call is causing it ?
>
> On 8/27/08, Mark (Germany) <[EMAIL PROTECTED]> wrote:
>
>
>
>
>
> > oh my gosh....
> > cake again.. typical
>
> > by using TINYINT(1) it is assumed that you have a checkbox toggle with
> > 0 and 1 as values i guess.
> > anyway, after changing it to TINYINT(2), this automagic correction is
> > no longer active
> > and my value now is -1 in the Database
> > Where in the documentation did i miss that?
>
> > Are there more of these automatic corrections where a normal cake user
> > would not assume it?
>
> > PS: about the white screen of death - anyway - are there any solutions
> > to it?
> > other than having to use a dummy "default"?
>
> > thx mark
>
> > On 26 Aug., 23:37, "Mark (Germany)" <[EMAIL PROTECTED]>
> > wrote:
> >> Well - CakePHP and Rapid Development can be two things that dont get
> >> along with each other sometimes.. :)
> >> i try for hours now...
>
> >> first of all if you do not set a default value cake crashes completely
> >> - white screen of death all of the sudden:
> >> $form->input('status',array('type'=>'radio','options'=>array(1=>Disapprove',
>
> >> 1=>'Approve'),'legend'=>false));
>
> >> so i was forced (i really hate that - if i am forced to workaround
> >> something) to add a dummy "pending" one:
> >> $form->input('status',array('type'=>'radio','options'=>array(0=>'Pending',-1=>Disapprove',
>
> >> 1=>'Approve'),'legend'=>false));
>
> >> ok, so far so good, but
>
> >> in the second code sample (i tried with both integer -1 0 1 and '-1'
> >> '0' '-1'), the -1 always gets changed to 1 when saved to the database
> >> - i debugged it and found out, that it is (inside of $this->data)
> >> still -1 after validation and - i did not believe it - after having
> >> saved the fields. so cake transformes it wrongly or something when
> >> saving it.
>
> >> the DB table setting is:
> >> `status` tinyint(1) NOT NULL default '0' COMMENT '-1 dissap. 1
> >> approved',
> >> so neg. values should be no problem...
>
> >> and the query clearly shows that it is cake's "fault":
> >> UPDATE `role_applications` SET `id` = 2, `status` = 1, `check_text` =
> >> 'somehting', `adminonly_text` = 'whatever', `checked_by` = 1,
> >> `check_date` = '2008-08-26 23:34:29' WHERE `role_applications`.`id` =
> >> 2
>
> >> anyone an idea what is going on?
> >> how can i use negative values for radio buttons then?
>
> >> if this goes on, i wont have any project done by the end of next
> >> year..
> >> mark
>
> --
> Marcin Domanskihttp://kabturek.info
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---