Suppose I have a simple table:
CREATE TABLE `things` (
`id` int(11) unsigned NOT NULL auto_increment,
`public_id` int(11) unsigned default NULL,
`blah` longtext,
`created` datetime default NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=7 DEFAULT CHARSET=latin1
My view consists of a textarea for 'blah' and a submit button. Upon
hitting submit:
function add()
{
if (!empty($this -> data['Thing']))
{
if ($this -> Thing -> save($this -> data['Thing']))
{
if ($this -> Thing -> saveField('public_id',
2342)) // example
value; can be anything
$this -> flash('Success!');
}
}
}
The result is a success message. With debug on, the SQL executed was
1 INSERT INTO `things` (`blah`) VALUES ([correct blah text])
1 0
2 SELECT LAST_INSERT_ID() AS insertID 1 1 0
3 SELECT COUNT(*) AS `count` FROM `things` AS `Thing` WHERE
`Thing`.`id` = [ID value] 1 1 0
Going into the database, the created row is ([automatic ID], NULL,
[correct blah text], NULL). In other words, saveField() didn't work
(though it claims it did), nor did 'created.' I'm aware 'created' is
cranky re: how its NULLs are placed, but I thought 'datetime default
NULL' would be enough.
Why are these two features DOA? Thanks.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---