php - hasAndBelongsToMany relationship in CakePHP not saving the data -


I am facing a problem in the KPHP and I want to go to Bellgoms bs_categories and < There are too many connections to the code> bs_listing_types tables (one category can have multiple entry types).

This is the table structure that I have used.

  bs_categories ------------ - id int (10) parent_it int (10) lft int (10) rgat int (10) title work (255) body Text meta_title formatting (255) meta_keyword text meta_desk text slog varchar (255) status int (1) date-time modified datetime bs_listing_types ----------------- id int (11) title varchar (255) position int (1) created datetime modified datetime bs_listing_types_categories ----------- ---------------- id int (11) listing_type_ident (11) Category_ID int (11)   

I have a model in Written code is written: / ** * andBelongSyahon Associations * * @Syar Array * / Public $ andBelongsetTime = Array ('ListTip' => Array ('Classname' = & gt; 'LitLight Type', 'Jointable' = 'Gtc:' listing_types_categories', 'ForeignKey' => 'listing_type_id', 'associationforeignkey' = & gt; 'Category_ID', 'Unique' = & gt; Keep 'Keep' 'Terms' = & gt; '', 'fields' = & gt; '', 'Order' =>, '' Border ''> & # 39; & # 39;; ';', 'Offset' = & gt; '', 'Finder' = & gt; '',));

At the time of saving, I am receiving the following data.

  Array ([Category] => Array ([listing_type_id] => Array [0] => 2 [1] => 3) [parent_id] = Ad [Meta_desc] = & gt; Ad [status] => 1] [ID] => Advertising [Meta_title] => Ad [Meta_keyword] = & gt; Ad [Meta_desc] => )   

But the problem is that this data is not saved in the bs_listing_types_categories table, am I wrong. help please!

According to the HABT KPPHP conference, the ID column is never present, the data is not saved.

  bs_listing_types_categories   

will only have the following fields listing_type_id int (11) category_ id int (11) For more information,

For example if the posts are related to tags in HABT, then the post_tatag id field Check it out. / P>

  create tab 'post' (`id`int (11) no null auto_ignment,` name 'varchar (255) no tap, `body` text tap, primary key (` id`) ; Create the table `tag` (` id` int (11) null auto_interpret, create 'name' varchar (255) tap, primary key (`id`)); Create tab `posts_tags` (` post_id` int (11) No tap, `tag_ id` integer (11) tap, primary key (` post_id`, `tag_ id`));   

Your table structure

Comments

Popular posts from this blog

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -

python - 'NoneType' object is not callable using 'find_all' in BeautifulSoup -