Hi,
I am having a problem saving records to the database when I enter a
numerical digit vs alpha character.  Below is the table definition in
mysql:

CREATE TABLE  `scripts`.`params` (
  `id` int(10) NOT NULL auto_increment,
  `value` varchar(32) NOT NULL,
  `type` enum('SYMBOL','VALUE') NOT NULL,
  `order` tinyint(4) NOT NULL,
  `created` datetime NOT NULL default '0000-00-00 00:00:00',
  `modified` datetime NOT NULL default '0000-00-00 00:00:00',
  `script_id` int(11) NOT NULL,
  `name` varchar(32) NOT NULL,
  PRIMARY KEY  USING BTREE (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=66 DEFAULT CHARSET=latin1

Array dump, using print_r() that is being passed to saveAll() method
is below:

this->data=Array
(
    [Action] => Array
        (
            [email] => 1
            [sms] => 0
            [twitter] => 0
            [facebook] => 0
        )

    [Param] => Array
        (
            [0] => Array
                (
                    [order] => 1
                    [type] => VALUE
                    [name] => val1
                    [value] => 1
                )

            [1] => Array
                (
                    [order] => 0
                    [type] => VALUE
                    [name] => val2
                    [value] => A
                )

        )

    [Script] => Array
        (
            [script_definition_id] => 61
            [user_id] => 3
        )

)

Everything will save to the database with the exception of Param[0].
Experimenting has revealed that it will only save the Param rows where
the Param[x].value is a Alpha character, in this case 'A' in
Param[1].value, and if I enter a numeric it does not even attempt to
save a row to the database.

Below is the SQL produced from the above saveAll() method call:

(default) 8 queries took 4 ms
Nr      Query   Error   Affected        Num. rows       Took (ms)
1       START TRANSACTION               0               0
2       INSERT INTO `scripts` (`script_definition_id`, `user_id`,
`modified`, `created`) VALUES (61, 3, '2010-06-20 22:12:19',
'2010-06-20 22:12:19')          1               1
3       SELECT LAST_INSERT_ID() AS insertID             1       1       0
4       INSERT INTO `actions` (`email`, `sms`, `twitter`, `facebook`,
`script_id`) VALUES (1, 0, 0, 0, 68)            1               1
5       SELECT LAST_INSERT_ID() AS insertID             1       1       0
6       INSERT INTO `params` (`order`, `type`, `name`, `value`, `script_id`,
`modified`, `created`) VALUES (0, 'VALUE', 'val2', 'A', 68,
'2010-06-20 22:12:21', '2010-06-20 22:12:21')           1               1
7       SELECT LAST_INSERT_ID() AS insertID             1       1       1
8       ROLLBACK                0               0

Any help is appreciated.  I do not understand why is only saves the
Param rows where the value is alpha, and does not even appear to
attempt to save rows where the Param.value is a numeric.

Thanks
Mark

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 cake-php@googlegroups.com
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?hl=en

Reply via email to