How are you saving data in items? (code for controller/view/and
model).
Would it be possible for you to use HABTM for table 2 and 4 to
automate some of the steps?



On Dec 8, 9:21 am, ridwan arifandi <[EMAIL PROTECTED]> wrote:
> i have 5 tables like these
>
> 1). purchases
>
> 2). purchase_details
>      - purchase_id
>      - item_id
> 3). items
>
> 4). purchase_item_details
>      - purchase_detail_id
>      - item_detail_id
> 5). item_details
>      - item_id
>
> in an action, i have to do more than one save action. rule
>
> 1). save data into purchases
> 2). get last insert id from table purchases
>
> 3). save data into items
> 4). get last insert id from table items
>
> 5). save data into purchase_details with those two variables
> ( purchase_id & item_id )
> 6). get last insert id from table purchase_details
>
> 7). save data into item_details with item_id
> 8). get last insert id from table item_details
>
> 9). save data into purchase_item_detail with those two variables
> ( purchase_detail_id & item_detail_id )
>
> so.. i get a problem at rule #3... it cannot save, dont know why, i
> have no error message at my web
>
> items table
>
> CREATE TABLE IF NOT EXISTS `items` (
>   `id` int(11) NOT NULL auto_increment,
>   `item_type_id` int(11) NOT NULL,
>   `item_brand_type_id` int(11) NOT NULL,
>   `desc` text NOT NULL,
>   `info` text NOT NULL,
>   `default_price` int(11) NOT NULL,
>   `entry_date` date NOT NULL,
>   `entry_by` int(11) NOT NULL,
>   `update_date` date NOT NULL,
>   `update_by` int(11) NOT NULL,
>   `f_expired` enum('t','f') NOT NULL,
>   `f_return` enum('t','f') NOT NULL,
>   `f_active` enum('t','f') NOT NULL,
>   PRIMARY KEY  (`id`)
> ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
>
> please help me...
--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to