21293 Posts in 5733 Topics by 2602 members
Page: 1 2
|Go to End|
8 January 2011 at 5:57am
That didn't seem to work I'm afriad, thinking about it though, could it be that I need to somehow convertinto an integer for it to be accepted by the database?
$caseInfo->Contact = $data['Contact'];
8 January 2011 at 6:04am
Well I'm off now, but basically that is what I was saying at the beginning... but my concern with your function is that it is getting the right DataObject and performing the update on it... as always Debug::show (or to log file) is you friend debug EVERYTHING and you'll figure it out!
and to confirm I very much doubt DataObject get_by_id, setField or write is broken. I raised a bug on it once and was embarrassed to find I had a it all wrong... if I'd have spent a little more effort debugging...
11 January 2011 at 11:36am
as swaiba said, it would help to see your myFifth class or just its static $db setup. Because from the screenshot i assume that you set up the contact field as boolean, that would explain why always 1 is saved to the db since both '1' and '2' casted to boolean = true. in your particiular case i would use 'Yes' => 1, 'No' => 0, or change the field type to integer
11 January 2011 at 11:40am
Thank you both for your help.
Apening, you are exactly right, I had figured this out and as you suspected the column in the database was cast as a boolean rather than an integer. Works perfectly now!
Page: 1 2
|Go to Top|